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

Add checking for prior calculation of virtual temperture before running 'prevents' #133

Merged
merged 18 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b1e5a70
updates for running C90C_ens and C90C_replay test cases
gmao-jstassi May 26, 2021
e6a757d
merge in Joe branch feature/jstassi/GEOSadas-5_27_1 and revised versi…
rtodling May 26, 2021
562feb4
edit as in 5_28_0
rtodling May 26, 2021
38acfc2
for some reason this is not a c360 run
rtodling May 27, 2021
c513e22
getting changes from Joe
rtodling May 31, 2021
45f6215
something is messed up in the npp_ompsnmeff_nc in 201712 - only obs a…
rtodling Jun 2, 2021
8202048
Adding routine to check if SFCSHP in input prepbufr files
gmao-msienkie Nov 16, 2021
35793a8
modify name of parameter file used in prevents step -
gmao-msienkie Nov 16, 2021
ba21453
Corrected typo, changed location of input parameter file
gmao-msienkie Nov 16, 2021
f9d3eb5
Add comment on latest changes to prologue of run script
gmao-msienkie Nov 16, 2021
1e83297
Merge branch 'develop' into feature/msienkie/check_prepbufr_sfcshp_vi…
gmao-msienkie Nov 17, 2021
4985b6b
replace some files that were modified in merge of 'develop'
gmao-msienkie Nov 17, 2021
3da0ff9
Merge branch 'develop' into feature/msienkie/check_prepbufr_sfcshp_vi…
gmao-msienkie Nov 17, 2021
7cbbf11
Merge branch 'develop' into feature/msienkie/check_prepbufr_sfcshp_vi…
gmao-msienkie Nov 17, 2021
232a390
Add a 'usage' statment to be printed out if the file name
gmao-msienkie Nov 20, 2021
2d25832
Merge branch 'develop' into feature/msienkie/check_prepbufr_sfcshp_vi…
rtodling Dec 14, 2021
acef19a
Update gmao_prepqc
gmao-msienkie Dec 14, 2021
e973614
Merge branch 'develop' into feature/msienkie/check_prepbufr_sfcshp_vi…
rtodling Dec 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Applications/NCEP_Paqc/GMAOprev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ ecbuild_add_executable (
SOURCES gblevents_gmao.f prevents.f
LIBS NCEP_bufr_r8i4 NCEP_w3_r8i4 GMAO_hermes)

ecbuild_add_executable (
TARGET check_virtmp.x
SOURCES check_virtmp.f
LIBS NCEP_bufr_r4i4)

string(REPLACE " " ";" tmp ${FREAL8})
foreach (flag ${tmp})
target_compile_options (gmao_prevents.x PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${flag}>)
Expand Down
58 changes: 58 additions & 0 deletions src/Applications/NCEP_Paqc/GMAOprev/check_virtmp.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
implicit none
real*8 hdr(1), tpc(1,20)
real*8 bmiss, getbmiss
CHARACTER(len=180) filn
CHARACTER(len=8) SUBSET
integer iret, idate, ilev, j, tvflg, lubfi
integer nargs, iargc
real vtcd

data lubfi /10/

nargs = iargc()
if (nargs .lt. 1) then
print *, 'Usage: check_virtmp.x prepbufr-file'
stop
end if
call getarg(1,filn)
open(unit=lubfi,file=filn,form='unformatted')

CALL OPENBF(LUBFI,'IN',LUBFI)
call ufbqcd(lubfi,'VIRTMP',vtcd)
tvflg = 1
subset = ''
iret = 0
do while (iret == 0 .and. subset /= 'SFCSHP')
CALL READMG(LUBFI,SUBSET,IDATE,IRET)
end do


C LOOP THROUGH THE INPUT MESSAGES - READ THE NEXT SUBSET
C ------------------------------------------------------

do while(iret .eq. 0)
CALL READSB(LUBFI,IRET)
IF(IRET .eq. 0) then
call ufbint(lubfi,hdr,1,1,ilev,'TYP')
call ufbevn(lubfi,tpc,1,1,20,ilev,'TPC')
do j = 1,20
if(tpc(1,j) == vtcd) tvflg = 0
if(tpc(1,j) >= bmiss) exit
end do
if (tvflg == 0) exit
else
subset = ''
iret = 0
do while (iret == 0 .and. subset /= 'SFCSHP')
CALL READMG(LUBFI,SUBSET,IDATE,IRET)
end do
endif
end do
if (tvflg == 0) then
print *,'VIRTUAL'
else
print *,'DRY'
end if

stop
end
22 changes: 21 additions & 1 deletion src/Applications/NCEP_Paqc/oiqc/gmao_prepqc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
# can be found by DAS, few other tweaks
# 18Oct2019 Meta Removed reference to 'Shell'; cleaned out
# code for old ACQC, ACARSQC
# 16Nov2021 Meta Add routine to check for previous virtual temperature
# calculation for SFCSHP in input prepbufr and skip
# recalculation of VIRTMP if found
#------------------------------------------------------------------

# make env vars readily available
Expand Down Expand Up @@ -302,13 +305,30 @@ sub gmaoprevents {
Assign("prepdv.$nymd.$hh", 51);
Assign("prevents.out.$nymd.$hh", 52);

$VTEMP = `check_virtmp.x $pref`;
open(PRVPARM, '>prepobs_prevents.parm');

if ( $VTEMP =~ /DRY/) { # input has sensible temperature
print "$0: PREVENTS calculate VIRTMP\n";
print PRVPARM " &PREVDATA DOVTMP= TRUE, DOFCST= TRUE DOBERR= TRUE / \n";
} else { # already has virtual temperature
print "$0: PREVENTS without VIRTMP\n";
print PRVPARM " &PREVDATA DOVTMP= FALSE, RECALC_Q= FALSE, DOFCST= TRUE DOBERR= TRUE / \n";
}

close(PRVPARM);


$FORT_CONVERT12 = "BIG_ENDIAN";
$FORT_CONVERT13 = "BIG_ENDIAN";

# Run check for virtual temperature
# ---------------------------------


# Run prevents
# -------------
$cmd = "gmao_prevents.x $dynf < $rcdir/prepobs_prevents.merra.parm";
$cmd = "gmao_prevents.x $dynf < prepobs_prevents.parm";
print "$0: $cmd\n" unless ( $opt_q );
# $rc = System ( $cmd, "/dev/null" ) unless ( $opt_n ) ;
$rc = system ( $cmd ) unless ( $opt_n ) ;
Expand Down