Skip to content

Commit

Permalink
add MAPL_Const in stats.F90, and comment line edits
Browse files Browse the repository at this point in the history
  • Loading branch information
saraqzhang committed May 3, 2022
1 parent 14794e6 commit 93ba5e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion GEOS_Util/post/g5fcst_stats.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
#=======================================================================
# name - g5fcst_stats.pl
# purpose - script to submit jobs to calculate screen level forecast statistics
# purpose - script to submit jobs to calculate forecast statistics
#
# key global variables -
# => $storedir: directory where output files get copied
Expand Down
17 changes: 13 additions & 4 deletions GEOS_Util/post/stats.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ subroutine bin_10x10 ( z,im,jm,z10x10 )

subroutine read_anal( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,ana_files,num_ana_files,undef )
use stats_mod
use MAPL_ConstantsMod
implicit none
type(fields) :: fields_2d(n2d)
type(fields) :: fields_3d(n3d)
Expand Down Expand Up @@ -2433,6 +2434,7 @@ subroutine read_anal( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,an
logical shift, defined, first
integer num, LL, i,j,k, loc, ndates, len
real Td, pp, ee
real tice, epsln, ec0, ec1, ec2
data id /0/
data num /0/
data shift /.false./
Expand Down Expand Up @@ -2555,17 +2557,24 @@ subroutine read_anal( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,an
if( check_names( vname(n),fields_2d(m)%alias(k) ) ) then
found_2d(m) = .true.
call gfio_getvar ( id,vname(n),nymd,nhms,im,jm,0,1,q,rc )
!! conversion (Bolton 1980)

if( trim(vname(n)) == 'N2_metre_dewpoint_temperature' ) then
tice= MAPL_TICE

This comment has been minimized.

Copy link
@gmao-rreichle

gmao-rreichle May 3, 2022

Contributor

I can never remember when to use 273.15 K and when to use 273.16 K. Perhaps the change from 273.15 to 273.16 is intentional. If not, MAPL_CELSIUS_TO_KELVIN=273.15 could be used instead of MAPL_TICE=273.16.

epsln = MAPL_EPSILON
!! empirical coeff. (Bolton 1980)
ec0 = 6.112
ec1 = 17.67
ec2 = 243.5

allocate( sp(im, jm) )
call gfio_getvar ( id,'Surface_pressure',nymd,nhms,im,jm,0,1,sp,rc )
do j=1,jm
do i=1,im
if( defined(q(i,j),undef) .and. defined(sp(i,j),undef) )then
Td = q(i,j)-273.15 ! to C
Td = q(i,j)-tice ! to C
pp = sp(i,j)/100. ! to mb
ee= 6.112*exp((17.67*Td)/(Td + 243.5))
q(i,j) = (0.622 * ee)/(pp - (0.378 * ee))
ee= ec0*exp((ec1*Td)/(Td + ec2))
q(i,j) = (epsln * ee)/(pp - (1.0-epsln) * ee)
else
print*, 'Td conversion fails,set q2m to UNDEF'
q(i,j) = undef
Expand Down
3 changes: 0 additions & 3 deletions GEOS_Util/post/statsNx.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
##sqz NOTE : this file has a copy
## in /discover/nobackup/qzhang/git_check/GEOSadas/install/etc/
## the run actually use that one instead of the one here.
# -------------------
# Stats RC Parameters
# -------------------
Expand Down

0 comments on commit 93ba5e2

Please sign in to comment.