Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Eddy Diffusivity (Km) and TKE Diagnostic Variables to UPP for HAFS #271

Closed
AndrewHazelton opened this issue Mar 1, 2021 · 8 comments
Labels
question Further information is requested

Comments

@AndrewHazelton
Copy link

Hello,

I have a set of PBL experiments that we are performing for the FV3-based Hurricane Analysis and Forecast System (HAFS), and we want to add diagnostic variables of eddy diffusivity (Km) and turbulent kinetic energy (TKE) to the UPP grib2 output. The variables are already output in the netcdf files that FV3 outputs, but we would like to get them on the same post-processed grid as the rest of our data.

The names of the variables output from the subroutine are "dkudiagnostic" and "tkediagnostic".
I have added these to the source code (on Orion) at:

/work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/INITPOST_NETCDF.f

I have also tried to add these to the source code for the requested fields (on Orion) at:

/work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/RQSTFLD.F

TKE is already a requested field.

I also added TDCMOM (the grib2 name for eddy diffusivity) to:

/work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/VRBLS3D_mod.f

However, I am still getting an error when I try to compile:

/work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/INITPOST_NETCDF.f(1287): error #6404: This name does not have a type, and must have an explicit type. [TDCMOM]

    ,lm,TDCMOM(1,jsta_2l,1))

------------^

/work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/INITPOST_NETCDF.f(1292): error #6404: This name does not have a type, and must have an explicit type. [TKE]

    ,lm,TKE(1,jsta_2l,1))

------------^

compilation aborted for /work/noaa/aoml-hafs1/ahazelto/HAFS2021/HAFS_20210219/HAFS/sorc/hafs_post.fd/sorc/ncep_post.fd/INITPOST_NETCDF.f

I was wondering: what steps would be needed to make sure this diagnostic TKE and eddy diffusivity can be correctly added and compiled?

Thanks!

Andy Hazelton (Andrew.Hazelton@noaa.gov)

@WenMeng-NOAA
Copy link
Collaborator

@AndrewHazelton You might get some guide for adding a new variable in UPP code at
https://github.com/NOAA-EMC/EMC_post/wiki/UPP-Code-Development#add-a-new-variable-in-upp

Also, the on-going PR #263 might be a good reference for your case. Please let me know if you need further information.

Thanks!

@AndrewHazelton
Copy link
Author

Wen,

Thank you for the information!

I am reading through the document, and one of the variables I need (TKE) is already in post_avblflds.xml.

However, the field gives a constant 0 value when I look at the grb2 output.

Where can I confirm that the TKE variable is correctly getting output or processed from the netcdf output files I have from HAFS?

Andy

@WenMeng-NOAA
Copy link
Collaborator

@AndrewHazelton The UPP internal variable assigned for 3D TKE at hybrid level is "q2". You might make the changes in INITPOST_NETCDF.f for reading "tkediagnostic" from netcdf and assign as q2.
You may check MDLFLD.f starting at line 3864 for writing out 3D TKE in grib2 to find this internal variable name "q2".

@AndrewHazelton
Copy link
Author

Wen, the output files I have are on pressure surfaces. That should also be available it looks like:

<param>
   <post_avblfldidx>22</post_avblfldidx>
   <shortname>TKE_ON_ISOBARIC_SFC</shortname>
   <pname>TKE</pname>
   <fixed_sfc1_type>isobaric_sfc</fixed_sfc1_type>
   <scale>3.0</scale>
</param>

So would it still need to be "q2" in INITPOST_NETCDF.f, or something else?

@WenMeng-NOAA
Copy link
Collaborator

@AndrewHazelton Yes, the q2 is the internal variable for TKE at hybrid level. You need to ensure in the read interface INITPOST_NETCDF.f, TKE is correctly read from the model output and passed into the internal variable for model hybrid level. The UPP has another process to interpolate fields from hybrid level into isobaric level.

@AndrewHazelton
Copy link
Author

Wen, thanks. I have added "tkediagnostic" to INITPOST_NETCDF.f, and it compiled OK.

  VarName='tkediagnostic'
    call read_netcdf_3d_scatter(me,ncid2d,1,im,jm,jsta,jsta_2l &
    ,jend_2u,MPI_COMM_COMP,icnt,idsp,spval,VarName &
    ,lm,Q2(1,jsta_2l,1))

I will do a test run and see if that variable works at least.

@WenMeng-NOAA WenMeng-NOAA added the question Further information is requested label Mar 8, 2021
@AndrewHazelton
Copy link
Author

Hi Wen, I just wanted to let you know that I have successfully completed adding these variables. Thanks for the guidance!

@WenMeng-NOAA
Copy link
Collaborator

@AndrewHazelton Glad to know your issue was solved.

EricJames-NOAA pushed a commit to EricJames-NOAA/UPP that referenced this issue Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants