Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions parm/rtofs_glo_ncoda_inc2mom6nc_lyr.input
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ MOM.res_3.nc
MOM.res_4.nc
&TShincname
&UVincname
&IDM 'idm ' = longitudinal array size
&JDM 'jdm ' = latitudinal array size
&IDM 'ii ' = longitudinal array size
&JDM 'jj ' = latitudinal array size
&KDM 'kk ' = number of layers restart
1324 'itest ' = longitudinal test point (optional, default 0)
1898 'jtest ' = latitudinal test point (optional, default 0)
&KDM 'kncoda' = number of NCODA levels equal to kk for layer increments
0.50 'zl ' = nominal depth of layer 1 from MOM archive
1.90 'zl ' = nominal depth of layer 2
Expand Down
1 change: 0 additions & 1 deletion scripts/exrtofs_glo_ncoda_hycom_var.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ cat << eof1 > odsetnl
&end
eof1

# kkm, kko, m, and n can be pulled from parm blkdat.input
cat << eof2 > ogridnl
&gridnl
delx(1) = 8896.78809,
Expand Down
44 changes: 23 additions & 21 deletions scripts/exrtofs_glo_ncoda_inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ echo dtg12 $dtg $dtgm1 $dtgm2
mode=incup
#inputgrid=0.08, change to 0p08
reg=GLB
DEPTH_FILE=${FIXrtofs}/depth_${reg}${inputgrid}_09m11ob2_mom6.nc
DEPTH_FILE=${FIXrtofs}/depth_${reg}.${inputgrid}_09m11ob2_mom6.nc
IDM=$(ncdump -h ${DEPTH_FILE} | grep 'nx =' | cut -d' ' -f3)
JDM=$(ncdump -h ${DEPTH_FILE} | grep 'ny =' | cut -d' ' -f3)
KDM=41 # or get from restart file?
SIZN="${IDM}x${JDM}"

ln -f -s ${FIXrtofs}/depth_${reg}.${inputgrid}_09m11ob2_mom6.nc .
ln -f -s ${FIXrtofs}/depth_${reg}.${inputgrid}_09m11ob2_mom6.nc depth_GLBb0.08_09m11ob2_mom6.nc
ln -f -s ${FIXrtofs}/regional.mom6.nc .

# 2. link to ncoda hycom var restart files
Expand All @@ -66,8 +66,8 @@ export vvelinc=vvel_${dtg}_analinc
export lyrthbg=lyrthk_${dtgm1}_fcstfld

#names can be changed. Names in INPUT will be MOM.inc.TSzh.nc, MOM.inc.UV.nc
export TShar=MOM.res_Y${jday:0:4}_D${jday:4:3}_S00000_inc.TSzh.nc
export UVar=MOM.res_Y${jday:0:4}_D${jday:4:3}_S00000_inc.TSzh.nc
export TShinc=MOM.res_Y${jday:0:4}_D${jday:4:3}_S00000_inc.TSzh.nc
export UVinc=MOM.res_Y${jday:0:4}_D${jday:4:3}_S00000_inc.UV.nc

# Check for the existence of analysis increment files
# These are needed to create the HYCOM incremental update file
Expand Down Expand Up @@ -108,48 +108,50 @@ else
fi

# Link the MOM6 template restart files
if [ -e $COMINm1/RESTART/${dtg:0:8}_000000.MOM.res.nc]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}_000000.MOM.res.nc MOM.res.nc
if [ -e $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res.nc ]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res.nc MOM.res.nc
else
msg="$COMINm1/${dtg:0:8}_000000.MOM.res.nc is missing"
msg="$COMINm1/RESTART/${dtg:0:8}.000000.MOM.res.nc is missing"
err_exit $msg
fi
if [ -e $COMINm1/RESTART/${dtg:0:8}_000000.MOM.res_1.nc]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}_000000.MOM_1.res.nc MOM.res.nc
if [ -e $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_1.nc ]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_1.nc MOM.res_1.nc
else
msg="$COMINm1/${dtg:0:8}_000000.MOM_1.res.nc is missing"
msg="$COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_1.nc is missing"
err_exit $msg
fi
if [ -e $COMINm1/RESTART/${dtg:0:8}_000000.MOM_3.res.nc]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}_000000.MOM_3.res.nc MOM.res.nc
if [ -e $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_3.nc ]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_3.nc MOM.res_3.nc
else
msg="$COMINm1/${dtg:0:8}_000000.MOM_3.res.nc is missing"
msg="$COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_3.nc is missing"
err_exit $msg
fi
if [ -e $COMINm1/RESTART/${dtg:0:8}_000000.MOM_4.res.nc]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}_000000.MOM_4.res.nc MOM.res.nc
if [ -e $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_4.nc ]; then
ln -sf $COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_4.nc MOM.res_4.nc
else
msg="$COMINm1/${dtg:0:8}_000000.MOM_4.res.nc is missing"
msg="$COMINm1/RESTART/${dtg:0:8}.000000.MOM.res_4.nc is missing"
err_exit $msg
fi


# copy modify input file with local vars
cp ${PARMrtofs}/${RUN}_${modID}.ncoda_inc2mom6nc.input ./ncoda_inc2mom6nc.input
sed -i -e "s/&TShincname/$TShar/" \
-e "s/&UVincname/$UVar/" \
cp ${PARMrtofs}/${RUN}_${modID}_ncoda_inc2mom6nc_lyr.input ./ncoda_inc2mom6nc_lyr.input
sed -i -e "s/&TShincname/$TShinc/g" \
-e "s/&UVincname/$UVinc/g" \
-e "s/&IDM/$IDM/g" \
-e "s/&JDM/$JDM/g" \
-e "s/&KDM/$KDM/g" \
-e "s/&seatmpinc/${tempinc}/g" \
-e "s/&salintinc/${salininc}/g" \
-e "s/&uvelinc/${uvelinc}/g" \
-e "s/&vvelinc/${vvelinc}/g" \
-e "s/&lyrthknam/${lyrthbg}" \
-e "s/&lyrthkname/${lyrthbg}/g" ./ncoda_inc2mom6nc_lyr.input

$EXECrtofs/rtofs_ncodaz_inc2mom6nc_glb_lyr.x < ncoda_inc2mom6nc_lyr.input >> $pgmout
err=$?; export err ; err_chk
echo " error from rtofs_ncodaz_inc2mom6nc_glb_lyr=",$err
cp $TShinc $COMOUT/rtofs_glo.$TShinc
cp $UVinc $COMOUT/rtofs_glo.$UVinc


msg="THE RTOFS_GLO_NCODA_INC JOB HAS ENDED NORMALLY on $(hostname) at $(date)"
postmsg "$msg"
Expand Down
3 changes: 3 additions & 0 deletions sorc/hycom_tools_for_mom6.fd/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ source ${BASE}/load_modules.sh ${dir_mod0}
make all

# move executables
for f in `ls -1 *.x`; do
cp $f ../../exec/rtofs_$f
done
mkdir -p ${BASE}/exec
mv *.x ${BASE}/exec

Expand Down
19 changes: 12 additions & 7 deletions sorc/hycom_tools_for_mom6.fd/ncodaz_inc2mom6nc_glb_lyr.f
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,17 @@ program ncodaz_inc2mom6nc_glb
c --- 'flnm_p' = name of ncoda density displacement file, or "NONE"
c --- 'flnm_h' = name of the background field layer thick. as ncoda binary

c itest,jtest show be read with blkini2, now hard coded
itest=1324
jtest=1898
call blkini(kncoda,'kncoda')
call blkini2(i,j,'itest ','kncoda')
if (j.eq.1) then
itest = i
call blkini(jtest, 'jtest ')
call blkini(kncoda, 'kncoda')
else
itest = 0
jtest = 0
kncoda = i
endif

if (kncoda.ne.kk) then
write(6,*)'error, kncoda has to be kk for lyr option'
stop
Expand Down Expand Up @@ -217,9 +224,7 @@ program ncodaz_inc2mom6nc_glb
read (*,'(a)') flnm_p
write (lp,'(2a)') 'Pncoda file: ',trim(flnm_p)
read (*,'(a)') flnm_h
write (lp,'(2a)') 'h background file: ',trim(flnm_p)
read (*,'(a)') flnm_h
write (lp,'(2a)') 'h background file: ',trim(flnm_h)rite (lp,'(2a)') 'h background file: ',trim(flnm_h)
write (lp,'(2a)') 'h background file: ',trim(flnm_h)

C

Expand Down