Skip to content

Commit 508edb4

Browse files
committed
get nco command from baselib
1 parent 45b8a9a commit 508edb4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

GEOSldas_App/lenkf_j_template.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
6464
source $GEOSBIN/g5_modules
6565
66+
setenv BASEBIN ${{BASEDIR}}/Linux/bin
67+
6668
setenv MPI_STACK {DETECTED_MPI_STACK}
6769
6870
if ( ${{MPI_STACK}} == "openmpi" ) then
@@ -103,11 +105,6 @@
103105
# reversed sequence for LADAS_COUPLING (Sep 2020) (needed when coupling with ADAS using different BASEDIR)
104106
setenv LD_LIBRARY_PATH ${{BASEDIR}}/${{ARCH}}/lib:${{ESMADIR}}/lib:${{LD_LIBRARY_PATH}}
105107
106-
module load nco
107-
# the nco module prepends to UDUNITS2_XML_PATH which Baselibs/g5_modules has already set
108-
# So here we reset to the one in Baselibs
109-
setenv UDUNITS2_XML_PATH ${{BASEDIR}}/${{ARCH}}/share/udunits/udunits2.xml
110-
111108
setenv RUN_CMD "$GEOSBIN/esma_mpirun -np "
112109
113110
#######################################################################
@@ -605,9 +602,9 @@
605602
606603
sed -i -e "s/NT/$LEN_SUB/g" timestamp.cdl
607604
sed -i -e "s/DATAVALUES/$tstep2/g" timestamp.cdl
608-
ncgen -k4 -o timestamp.nc4 timestamp.cdl
609-
ncrcat -h $EXPID.$ThisCol.${{YYYY}}${{MM}}${{DD}}_* ${{EXPID}}.${{ThisCol}}.$YYYY$MM$DD.nc4
610-
ncks -4 -h -v time_stamp timestamp.nc4 -A ${{EXPID}}.${{ThisCol}}.$YYYY$MM$DD.nc4
605+
$BASEBIN/ncgen -k4 -o timestamp.nc4 timestamp.cdl
606+
$BASEBIN/ncrcat -h $EXPID.$ThisCol.${{YYYY}}${{MM}}${{DD}}_* ${{EXPID}}.${{ThisCol}}.$YYYY$MM$DD.nc4
607+
$BASEBIN/ncks -4 -h -v time_stamp timestamp.nc4 -A ${{EXPID}}.${{ThisCol}}.$YYYY$MM$DD.nc4
611608
/bin/rm timestamp.cdl
612609
/bin/rm timestamp.nc4
613610
# rudimentary check for desired nc4 file; if ok, delete sub-daily files
@@ -748,7 +745,7 @@
748745
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_internal_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
749746
# copy generic restart file to final location/name but remove lat/lon variables
750747
# (lat/lon variables are not correct when running in EASE-grid tile space)
751-
ncks -4 -O -C -x -v lat,lon ${{rstf}}${{ENSID}}_internal_checkpoint $tmp_file
748+
$BASEBIN/ncks -4 -O -C -x -v lat,lon ${{rstf}}${{ENSID}}_internal_checkpoint $tmp_file
752749
/bin/rm -f ${{rstf}}${{ENSID}}_internal_checkpoint
753750
set old_rst = `/usr/bin/readlink -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst`
754751
/bin/rm -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst
@@ -780,7 +777,7 @@
780777
set TM = `echo $ThisTime | cut -c5-6`
781778
set THISDIR = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{TY}}/M${{TM}}/
782779
if (! -e $THISDIR ) mkdir -p $THISDIR
783-
(ncks -4 -O -C -x -v lat,lon $rfile ${{THISDIR}}${{EXPID}}.landpert_internal_rst.${{ThisTime}}.nc4;\\
780+
($BASEBIN/ncks -4 -O -C -x -v lat,lon $rfile ${{THISDIR}}${{EXPID}}.landpert_internal_rst.${{ThisTime}}.nc4;\\
784781
/usr/bin/gzip ${{THISDIR}}${{EXPID}}.landpert_internal_rst.${{ThisTime}}.nc4; \\
785782
/bin/rm -f $rfile) &
786783
end

0 commit comments

Comments
 (0)