Output new meteo variables along trajectory

Questions and postings pertaining to the development of HYSPLIT, feature enhancements, and HYSPLIT internals. HYSPLIT source code and algorithms are discussed here.
Post Reply
khartig
Posts: 16
Joined: June 16th, 2020, 4:22 pm
Registered HYSPLIT User: Yes

Output new meteo variables along trajectory

Post by khartig »

I'm modifying the Linux source code to output the U and V wind components as diagnostic variables along a trajectory using the setup flags tm_uwnd and tm_vwnd. The meteo data I'm using is from CESM, on a lat/lon grid in m/s. I have the trajectory output file successfully producing a new column for each of my new diagnostic variables, but most values are in the range +/- 0.003 with only a few getting up to order 0.01 (based on inspection of my input data in the region where my trajectories are (high latitudes, January, below 500m) I expect something on the order of 0.1 for U and 0.1-10 for V.). Hoping someone can tell me what I'm missing, or at least confirm if the issue is more likely with the source code modifications or with my input meteo files; I've summarized the modifications made so far below.

In library/hysplit/DEFMETO.INC
add to TYPE MARK:

Code: Select all

INTEGER    :: uwnd            ! zonal wind speed
INTEGER    :: vwnd            ! meridional wind speed
increase dimensions of tmrk in TYPE ASET from 10 -> 12:

Code: Select all

REAL       :: tmrk (12)       ! trajectory endpoint meteo marker variable
In library/hysplit/advmet.f
add calls to ADV3NT around line 359:

Code: Select all

IF(METO%FLAG%UWND.GT.0)THEN
!       zonal wind
    CALL ADV3NT(U(:,:,:,K1),XP,YP,ZX,VAR1,GLOBAL,NXP,NYP)
    CALL ADV3NT(U(:,:,:,K2),XP,YP,ZX,VAR2,GLOBAL,NXP,NYP)
    METO%TMRK(METO%FLAG%UWND)=(VAR2-VAR1)*TF+VAR1
END IF
			
IF(METO%FLAG%VWND.GT.0)THEN
!       meridional wind
    CALL ADV3NT(V(:,:,:,K1),XP,YP,ZX,VAR1,GLOBAL,NXP,NYP)
    CALL ADV3NT(V(:,:,:,K2),XP,YP,ZX,VAR2,GLOBAL,NXP,NYP)
    METO%TMRK(METO%FLAG%VWND)=(VAR2-VAR1)*TF+VAR1
END IF
In library/hysplit/trjdsk.f
(optional) increase decimal precision of diagnostic output variables from F8.1 to F8.3:

Code: Select all

WRITE(KF11,'(8I6,F8.1,2F9.3,11(1X,F8.3))')   &
In source/hymodelt.F
Define integers TM_UWND, TM_VWND
Read in TM_UWND and TM_VWND in NAMELIST/SETUP/
Set TM_UWND=0 and TM_VWND=0 in optional namelist configuration, before opening namelist file
Set flags in METO:

Code: Select all

METO%FLAG%UWND=0
METO%FLAG%VWND=0
...
IF(TM_UWND.GT.0)THEN
    NDIAG=NDIAG+1
    LABEL(NDIAG)='UWIND'
    METO%FLAG%UWND=NDIAG
END IF

IF(TM_VWND.GT.0)THEN
    NDIAG=NDIAG+1
    LABEL(NDIAG)='VWIND'
    METO%FLAG%VWND=NDIAG
END IF
write new tm_* flags to TRAJ.CFG:

Code: Select all

WRITE(KF26,'(A,I1,A)')' tm_uwnd = ',tm_uwnd,','
WRITE(KF26,'(A,I1,A)')' tm_vwnd = ',tm_vwnd,','
christopher.loughner
Posts: 68
Joined: August 15th, 2017, 3:59 pm
Registered HYSPLIT User: No

Re: Output new meteo variables along trajectory

Post by christopher.loughner »

The units of the U and V that you carried through are in units of grids/min. To convert to m/s, you need to change your uwnd and vwnd equations in advmet as follows:

METO%TMRK(METO%FLAG%UWND)=((VAR2-VAR1)*TF+VAR1)*GX(II,JJ)/60.

METO%TMRK(METO%FLAG%VWND)=((VAR2-VAR1)*TF+VAR1)*GY(II,JJ)/60.
Post Reply

Return to “Developers”