From 454aa4f797eb322e356271c8537174a028e7b0f9 Mon Sep 17 00:00:00 2001 From: WenMeng-NOAA <48260754+WenMeng-NOAA@users.noreply.github.com> Date: Wed, 9 Oct 2019 14:05:00 -0400 Subject: [PATCH] Post libs (#9) * Add capability of building ncep_post v8.0.0 library for running in-line post. * Add the capability for building post library on WCOSS phase1/2. --- modulefiles/post/lib-v8.0.0-cray-intel | 57 ++++++++ modulefiles/post/lib-v8.0.0-hera | 54 ++++++++ modulefiles/post/lib-v8.0.0-wcoss | 54 ++++++++ modulefiles/post/lib-v8.0.0-wcoss_dell_p3 | 52 ++++++++ sorc/ncep_post.fd/CALWXT_BOURG.f | 5 +- sorc/ncep_post.fd/build_ncepost_lib.sh | 44 +++++++ sorc/ncep_post.fd/makefile_lib | 152 ++++++++++++++++++++++ 7 files changed, 417 insertions(+), 1 deletion(-) create mode 100755 modulefiles/post/lib-v8.0.0-cray-intel create mode 100755 modulefiles/post/lib-v8.0.0-hera create mode 100755 modulefiles/post/lib-v8.0.0-wcoss create mode 100755 modulefiles/post/lib-v8.0.0-wcoss_dell_p3 create mode 100755 sorc/ncep_post.fd/build_ncepost_lib.sh create mode 100644 sorc/ncep_post.fd/makefile_lib diff --git a/modulefiles/post/lib-v8.0.0-cray-intel b/modulefiles/post/lib-v8.0.0-cray-intel new file mode 100755 index 0000000000..3c34033ae2 --- /dev/null +++ b/modulefiles/post/lib-v8.0.0-cray-intel @@ -0,0 +1,57 @@ +#%Module###################################################################### +## Jun.Wang@noaa.gov: Started NCEPPOST lib v6.3.0 +## Wen.Meng@noaa.gov 10/2019: Upgraded to v8.0.0 +##_____________________________________________________ +proc ModulesHelp { } { +puts stderr "Set environment veriables for NCEPPOST" +puts stderr "This module initializes the enviro nment " +puts stderr "for the Intel Compiler Suite $version\n" +} +module-whatis " NCEPPOST lib whatis description" + +#set ver v6.3.0 +#set envir dev +#set NCEPLIB /nwprod/lib + +#set sys [uname sysname] + +#setenv COMPF_MP mpiifort +setenv myFC ftn +setenv myFCFLAGS "-O2 -convert big_endian -traceback -g -fp-model source -qopenmp -fpp" +setenv myCPP /lib/cpp +setenv myCPPFLAGS "-P" +setenv ARCHV ar +setenv CPPC /lib/cpp +setenv version v8.0.0 +# + +module purge + +module use -a /usrx/local/prod/modulefiles +module use -a /gpfs/hps/nco/ops/nwprod/lib/modulefiles + +# Loading Intel Compiler Suite +module load PrgEnv-intel +module load craype-sandybridge +module switch intel intel/15.0.3.187 +module load craype/2.3.0 + +# Loading nceplibs modules +module load jasper-gnu-sandybridge/1.900.1 +module load png-gnu-sandybridge/1.2.49 +module load zlib-gnu-sandybridge/1.2.7 +module load g2-intel/3.1.0 +module load g2tmpl-intel/1.5.0 +#module load xmlparse/v2.0.0 + +module load w3emc-intel/2.2.0 +module load w3nco/2.0.6 +module load w3nco-intel/2.0.6 +module load bacio-intel/2.0.1 +module load gfsio-intel/1.1.0 +#module load sigio/2.1.0 +module load ip-intel/3.0.0 +module load sp-intel/2.0.2 +module load crtm-intel/2.2.6 + + diff --git a/modulefiles/post/lib-v8.0.0-hera b/modulefiles/post/lib-v8.0.0-hera new file mode 100755 index 0000000000..715b5c7f9f --- /dev/null +++ b/modulefiles/post/lib-v8.0.0-hera @@ -0,0 +1,54 @@ +#%Module###################################################################### +## Jun.Wang@noaa.gov: Started NCEPPOST lib v6.3.0 +## Wen.Meng@noaa.gov 10/2019: Upgraded to v8.0.0 +##_____________________________________________________ +proc ModulesHelp { } { +puts stderr "Set environment veriables for NCEPPOST" +puts stderr "This module initializes the enviro nment " +puts stderr "for the Intel Compiler Suite $version\n" +} +module-whatis " NCEPPOST lib whatis description" + +#set ver v6.3.0 +#set envir dev +#set NCEPLIB /nwprod/lib + +#set sys [uname sysname] + +#setenv COMPF_MP mpiifort +setenv myFC mpiifort +setenv myFCFLAGS "-O3 -convert big_endian -traceback -g -fp-model source -qopenmp -fpp" +setenv myCPP /lib/cpp +setenv myCPPFLAGS "-P" +setenv ARCHV ar +setenv CPPC /lib/cpp +setenv version v8.0.0 +# + +module purge + +# Loading Intel Compiler Suite +#module load intel/19.0.4.243 +#module load impi/2019.0.4 +module load intel/18.0.5.274 +module load impi/2018.0.4 + +# Loading nceplibs modules +module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles +module load jasper/1.900.1 +module load png/1.2.44 +module load z/1.2.11 +module load g2/3.1.0 +module load g2tmpl/1.5.0 +#module load xmlparse/v2.0.0 + +module load w3emc/2.3.1 +module load w3nco/2.0.7 +module load bacio/2.0.3 +module load gfsio/1.1.0 +#module load sigio/2.1.1 +module load ip/3.0.2 +module load sp/2.0.3 +module load crtm/2.2.5 + + diff --git a/modulefiles/post/lib-v8.0.0-wcoss b/modulefiles/post/lib-v8.0.0-wcoss new file mode 100755 index 0000000000..7fa2710b64 --- /dev/null +++ b/modulefiles/post/lib-v8.0.0-wcoss @@ -0,0 +1,54 @@ +#%Module###################################################################### +## Jun.Wang@noaa.gov: Started NCEPPOST lib v6.3.0 +## Wen.Meng@noaa.gov 10/2019: Upgraded to v8.0.0 +##_____________________________________________________ +proc ModulesHelp { } { +puts stderr "Set environment veriables for NCEPPOST" +puts stderr "This module initializes the enviro nment " +puts stderr "for the Intel Compiler Suite $version\n" +} +module-whatis " NCEPPOST lib whatis description" + +#set ver v6.3.0 +#set envir dev +#set NCEPLIB /nwprod/lib + +#set sys [uname sysname] + +#setenv COMPF_MP mpiifort +setenv myFC mpiifort +setenv myFCFLAGS "-O3 -convert big_endian -traceback -g -fp-model source -qopenmp -fpp" +setenv myCPP /lib/cpp +setenv myCPPFLAGS "-P" +setenv ARCHV ar +setenv CPPC /lib/cpp +setenv version v8.0.0 +# + +module purge + +# Loading Intel Compiler Suite +module load ics/16.0.3 +module load ibmpe +#module load ics/15.0.3 +##module load ibmpe/1.3.0.12 +#module load prod_util/1.1.0 + +# Loading nceplibs modules +module load jasper/v1.900.1 +module load png/v1.2.44 +module load z/v1.2.6 +module load g2/v3.1.0 +module load g2tmpl/v1.5.0 +#module load xmlparse/v2.0.0 + +module load w3emc/v2.2.0 +module load w3nco/v2.0.6 +module load bacio/v2.0.1 +module load gfsio/v1.1.0 +#module load sigio/2.1.0 +module load ip/v3.0.1 +module load sp/v2.0.2 +module load crtm/v2.2.4 + + diff --git a/modulefiles/post/lib-v8.0.0-wcoss_dell_p3 b/modulefiles/post/lib-v8.0.0-wcoss_dell_p3 new file mode 100755 index 0000000000..97f3506a34 --- /dev/null +++ b/modulefiles/post/lib-v8.0.0-wcoss_dell_p3 @@ -0,0 +1,52 @@ +#%Module###################################################################### +## Jun.Wang@noaa.gov: Started NCEPPOST lib v6.3.0 +## Wen.Meng@noaa.gov 10/2019: Upgraded to v8.0.0 +##_____________________________________________________ +proc ModulesHelp { } { +puts stderr "Set environment veriables for NCEPPOST" +puts stderr "This module initializes the enviro nment " +puts stderr "for the Intel Compiler Suite $version\n" +} +module-whatis " NCEPPOST lib whatis description" + +#set ver v6.3.0 +#set envir dev +#set NCEPLIB /nwprod/lib + +#set sys [uname sysname] + +#setenv COMPF_MP mpiifort +setenv myFC mpiifort +setenv myFCFLAGS "-O3 -convert big_endian -traceback -g -fp-model source -qopenmp -fpp" +setenv myCPP /lib/cpp +setenv myCPPFLAGS "-P" +setenv ARCHV ar +setenv CPPC /lib/cpp +setenv version v8.0.0 +# + +module purge + +# Loading Intel Compiler Suite +module load ips/18.0.1.163 +module load impi/18.0.1 +#module load prod_util/1.1.0 + +# Loading nceplibs modules +module load jasper/1.900.1 +module load libpng/1.2.59 +module load zlib/1.2.11 +module load g2/3.1.0 +module load g2tmpl/1.5.0 +#module load xmlparse/v2.0.0 + +module load w3emc/2.3.0 +module load w3nco/2.0.6 +module load bacio/2.0.2 +module load gfsio/1.1.0 +#module load sigio/2.1.0 +module load ip/3.0.1 +module load sp/2.0.2 +module load crtm/2.2.6 + + diff --git a/sorc/ncep_post.fd/CALWXT_BOURG.f b/sorc/ncep_post.fd/CALWXT_BOURG.f index 078e224f2d..8406f3f08c 100644 --- a/sorc/ncep_post.fd/CALWXT_BOURG.f +++ b/sorc/ncep_post.fd/CALWXT_BOURG.f @@ -88,6 +88,8 @@ subroutine calwxt_bourg_post(im,jm,jsta_2l,jend_2u,jsta,jend,lm,lp1, & ! initialize weather type array to zero (ie, off). ! we do this since we want ptype to represent the ! instantaneous weather type on return. + print *,'in calwxtbg, jsta,jend=',jsta,jend,' im=',im + print *,'in calwxtbg,me=',me,'iseed=',iseed ! !$omp parallel do do j=jsta,jend @@ -104,9 +106,10 @@ subroutine calwxt_bourg_post(im,jm,jsta_2l,jend_2u,jsta,jend,lm,lp1, & !!$omp parallel do & ! & private(a,lmhk,tlmhk,iwrml,psfck,lhiwrm,pintk1,pintk2,area1, & ! & areape,dzkl,surfw,r1,r2) -! print *,' jsta,jend=',jsta,jend,' im=',im + print *,'incalwxtbg, rn',maxval(rn),minval(rn) do j=jsta,jend + if(me==1)print *,'incalwxtbg, j=',j do i=1,im lmhk = min(nint(lmh(i,j)),lm) psfck = pint(i,j,lmhk+1) diff --git a/sorc/ncep_post.fd/build_ncepost_lib.sh b/sorc/ncep_post.fd/build_ncepost_lib.sh new file mode 100755 index 0000000000..a5f79f8aeb --- /dev/null +++ b/sorc/ncep_post.fd/build_ncepost_lib.sh @@ -0,0 +1,44 @@ +SHELL=/bin/sh + +module purge +set -x +mac=$(hostname | cut -c1-1) +mac2=$(hostname | cut -c1-2) + +if [ $mac2 = hf ] ; then # For Hera + machine=hera + . /etc/profile + . /etc/profile.d/modules.sh +elif [ $mac = v -o $mac = m ] ; then # For Dell + machine=wcoss_dell_p3 + . $MODULESHOME/init/bash +elif [ $mac = t -o $mac = e -o $mac = g ] ; then # For WCOSS + machine=wcoss + . /usrx/local/Modules/default/init/bash +elif [ $mac = l -o $mac = s ] ; then # wcoss_c (i.e. luna and surge) + export machine=cray-intel +fi +export version=${1:-"v8.0.0"} + +moduledir=`dirname $(readlink -f ../../modulefiles/post)` +module use -a ${moduledir} +module load post/lib-${version}-${machine} +#module load nceppost_modulefile + +# +module list + +#sleep 1 + +BASE=`pwd` + +##################################### +cd ${BASE} +rm *.o *.mod incmod +#mkdir -m 775 -p $BASE/../../lib/include/ncep_post_${version}_4 +make -f makefile_lib clean +mkdir -m 775 -p include/ncep_post_${version}_4 +make -f makefile_lib + +exit 0 + diff --git a/sorc/ncep_post.fd/makefile_lib b/sorc/ncep_post.fd/makefile_lib new file mode 100644 index 0000000000..2af4ff0b62 --- /dev/null +++ b/sorc/ncep_post.fd/makefile_lib @@ -0,0 +1,152 @@ +################################################################################ +# +# Makefile for NCEP Post +# +# Use: +# make - build the executable +# make clean - start with a clean slate +# +# The following macros will be of interest: +# +# TARGET - name of the executable +# FC - name of Fortran compiler +# CPP - name of CPP +# ARCH - architecture +# CPPFLAGS - CPP flags +# OPTS - compiler code optimizations +# LIST - source listing +# SMP - threading +# TRAPS - runtime traps for floating point exceptions +# PROFILE - source code profiling ( -pg ) +# DEBUG - -g +# MEM - user data area and stack size +# MAP - load map +# W3LIB - w3lib +# BACIO - bacio lib +# ESSL - ESSL library +# MASS - MASS library +# HPMLIB - hpm lib +# SEARCH - library search location +# +# This version for eta_post with more intelligent memory allocation +# Jim Tuccillo Feb 2001 +# +# This version for eta_post with asynchronous I/O server. +# Jim Tuccillo June 2001 + +# This version for NEMS_POST +# Jun Wang June 2010 +# +################################################################################# +# +# Define the name of the executable +# + #POSTLIBPATH=../.. + #TARGET = ${POSTLIBPATH}/lib/libncep_post_${version}_4.a + #INCMOD= ${POSTLIBPATH}/lib/include/ncep_post_${version}_4 + TARGET = libncep_post_${version}_4.a + INCMOD = include/ncep_post_${version}_4 + AR = ar + ARFLAGS = -rv + +# +# CPP, Compiler, and Linker Options +# + +#FC = mpfort -compiler ifort +#CPP = /lib/cpp -P +FC = $(myFC) $(myFCFLAGS) +CPP = $(myCPP) $(myCPPFLAGS) +ARCH = auto +CPPFLAGS = -DLINUX +OPTS = -O -fp-model strict +LIST = +FREE = -FR +#TRAPS = -qflttrap=ov:und:zero:inv:inex -qcheck -qinitauto=FF +TRAPS = +PROFILE = +DEBUG = -g +CFLAGS = -DLINUX -Dfunder -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' +W3LIBDIR = /nwprod/lib + +#CRTM_INC = -I/nwprod/lib/incmod/crtm_2.0.6 +#W3_INC = -I/nwprod/lib/incmod/w3emc_v2.0.3_4 +#SIGIO_INC = -I/nwprod/lib/incmod/sigio_v1.0.1_4 +#GFSIO_INC = -I/nwprod/lib/incmod/gfsio_v1.1.0_4 +##jw G2_INC = -I/nwprod/lib/incmod/g2_4 -I/nwprod/lib/incmod/g2tmpl +#G2_INC = -I/nems/save/Jun.Wang/NGAC/lib/g2tmpl_v1.2.3/incmod/g2tmpl -I/nwprod/lib/incmod/g2_4 +#XML_INC = -I/nwprod/lib/incmod/xmlparse + + + +SEARCH = +# +# Assemble Options +# +#FFLAGS = $(OPTS) $(FREE) $(TRAPS) $(DEBUG) -I$(CRTM_INC) -I$(W3EMC_INC4) -I$(G2_INC4) -I$(G2TMPL_INC) -I$(XMLPARSE_INC) -I$(SIGIO_INC4) -I$(GFSIO_INC4) +FFLAGS = $(OPTS) $(FREE) $(TRAPS) $(DEBUG) -I$(CRTM_INC) -I$(W3EMC_INC4) -I$(G2_INC4) -I$(G2TMPL_INC) -I$(SIGIO_INC4) -I$(GFSIO_INC4) +FFLAGST = $(OPTS) $(FREE) $(TRAPS) $(DEBUG) -I$(CRTM_INC) -I$(W3EMC_INC4) -I$(SIGIO_INC4) -I$(GFSIO_INC4) + +# +# Threaded object files +# +OBJST= kinds_mod.o machine.o physcons.o ZENSUN.o CLDFRAC_ZHAO.o GFSPOST.o +# +# Non-threaded object files +# +#OBJXML= post_t.o +# +OBJS= VRBLS2D_mod.o VRBLS3D_mod.o VRBLS4D_mod.o MASKS_mod.o PMICRPH.o SOIL_mod.o \ + CMASSI.o CTLBLK.o GRIDSPEC.o LOOKUP.o PARAMR.o RHGRD.o RQSTFLD.o xml_perl_data.o \ + cuparm.o params.o svptbl.o get_postfilename.o grib2_module.o \ + SET_LVLSXML.o FILL_PSETFLD.o \ + BNDLYR.o BOUND.o CALCAPE.o CALDWP.o CALDRG.o CALHEL.o CALLCL.o \ + CALMCVG.o CALPOT.o CALPW.o CALRH.o CALRCH.o CALRH_GSD.o \ + CALSTRM.o CALTAU.o CALTHTE.o CALVIS.o CALVIS_GSD.o CALVOR.o CALWXT.o \ + CALWXT_RAMER.o CALWXT_BOURG.o CALWXT_REVISED.o CALRH_PW.o \ + CALWXT_EXPLICIT.o CALWXT_DOMINANT.o \ + CLDRAD.o CLMAX.o COLLECT.o COLLECT_LOC.o DEWPOINT.o \ + FDLVL.o FGAMMA.o FIXED.o FRZLVL.o FRZLVL2.o \ + GET_BITS.o GRIBIT.o LFMFLD.o \ + MAPSSLP.o MISCLN.o MIXLEN.o MDL2P.o MDLFLD.o \ + NGMFLD.o NGMSLP.o OTLFT.o OTLIFT.o SLP_new.o SLP_NMM.o EXCH.o \ + PARA_RANGE.o PROCESS.o EXCH2.o \ + READCNTRL.o READ_xml.o SET_OUTFLDS.o SCLFLD.o \ + SMOOTH.o SURFCE.o \ + SPLINE.o TABLE.o TABLEQ.o TRPAUS.o TTBLEX.o WETBULB.o \ + CALMICT.o MICROINIT.o GPVS.o MDL2SIGMA.o \ + ETCALC.o CANRES.o CALGUST.o WETFRZLVL.o SNFRAC.o MDL2AGL.o SNFRAC_GFS.o \ + AVIATION.o DEALLOCATE.o \ + CALPBL.o MDL2SIGMA2.o CALRH_GFS.o LFMFLD_GFS.o \ + CALRAD_WCLOUD_newcrtm.o MDL2THANDPV.o CALPBLREGIME.o POLEAVG.o \ + ICAOHEIGHT.o \ + GEO_ZENITH_ANGLE.o GFIP3.o GRIDAVG.o CALUPDHEL.o \ + AllGETHERV_GSD.o MSFPS.o SELECT_CHANNELS.o ALLOCATE_ALL.o \ + gtg_ctlblk.o gtg_indices.o gtg_filter.o gtg_compute.o gtg_config.o map_routines.o gtg_algo.o + + +.SUFFIXES: .F .f .o .f90 .c + +.F.f: + $(CPP) $(CPPFLAGS) $< > $*.f + +$(TARGET): $(OBJST) $(OBJXML) $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJST) $(OBJXML) $(OBJS) $(LIBS) + mv *.mod $(INCMOD) + +.f.o: + $(FC) $(FFLAGS) -c $< + +.f90.o: + $(FC) $(FFLAGS) -c $< + +.c.o : + ${CC} ${CFLAGS} -c $< + +clean: + /bin/rm -rf libncep_post_*.a *.lst *.o include +# +postcntrl_t.o : postcntrl_t.f90 + $(FC) $(FFLAGS) postcntrl_t.f90 + +