Skip to content

Commit

Permalink
Merge pull request #221 from bertinia/master
Browse files Browse the repository at this point in the history
update DAV modules and ncar_pylib version
  • Loading branch information
bertinia committed Jul 17, 2020
2 parents 469c5da + 0433b9c commit 67d1b1b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 22 deletions.
12 changes: 6 additions & 6 deletions Machines/dav_modules
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

echo "Python boot-strap modules for NCAR DAV"

module load python/2.7.15
module load intel/17.0.1
module load python/2.7.16
module load gnu/8.3.0
module load ncarenv
module load ncarcompilers
module load impi
module load netcdf/4.6.1
module load openmpi/3.1.4
module load netcdf/4.7.1
module load nco/4.7.4
module load ncl/6.6.2
module load ncl/6.6.2

# clone the ncat virtualenv first with helper script ncar_pylib
# use "ncar_pylib --help" to see all options
ncar_pylib -c 20190718 ${pp_dir}/cesm-env2
ncar_pylib -c 20191031 ${pp_dir}/cesm-env2

export PYTHONPATH=${pp_dir}/cesm-env2/lib/python2.7/site-packages

Expand Down
12 changes: 6 additions & 6 deletions Machines/machine_postprocess.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
<pythonpath></pythonpath>
<f2py fcompiler="intelem" f77exec="/glade/apps/opt/modulefiles/ys/cmpwrappers/ifort">f2py</f2py>
<za>
<compiler>ifort</compiler>
<compiler>gfortran</compiler>
<flags>-c -g -O2</flags>
<include>-I/glade/u/apps/dav/opt/netcdf/4.6.1/intel/17.0.1/include</include>
<libs>-L/glade/u/apps/dav/opt/netcdf/4.6.1/intel/17.0.1/lib -lnetcdff -lnetcdf</libs>
<include>-I/glade/u/apps/dav/opt/netcdf/4.7.1/gnu/8.3.0/include</include>
<libs>-L/glade/u/apps/dav/opt/netcdf/4.7.1/gnu/8.3.0/lib -lnetcdff -lnetcdf</libs>
</za>
<reset_modules>
<module>module purge</module>
</reset_modules>
<modules>
<module>module load intel/17.0.1</module>
<module>module load gnu/8.3.0</module>
<module>module load ncarenv</module>
<module>module load ncarcompilers</module>
<module>module load impi</module>
<module>module load netcdf/4.6.1</module>
<module>module load openmpi/3.1.4</module>
<module>module load netcdf/4.7.1</module>
<module>module load nco/4.7.4</module>
<module>module load ncl/6.6.2</module>
</modules>
Expand Down
9 changes: 6 additions & 3 deletions Tools/ration_script_dav
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
#SBATCH -o ration_test.out.%J

module purge
module load python/2.7.14
module load intel/17.0.1
module load python/2.7.16
module load gnu/8.3.0
module load ncarenv
module load ncarcompilers
module load impi
module load openmpi/3.1.4
module load netcdf/4.7.1
module load nco/4.7.4
module load ncl/6.6.2


. /gpfs/fs1/work/aliceb/sandboxes/dev/postprocessing_dav/cesm-env2/bin/activate
Expand Down
44 changes: 37 additions & 7 deletions atm_diag/regridclimo.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ end if
var_in_exclude = (/"lat", "lon", "area", "date_written", "time_written"/)

;--- Specify a list of variables on the source SE file that should be directly copied
var_in_copy = (/"time_bnds"/)
var_in_copy = (/"time_bnds","cosp_ht_bnds","cosp_sr_bnds","cosp_prs_bnds","cosp_tau_bnds"/)

;--- Specify a list of variables to be regridded
var_out = "All_Variables" ; to be regridded
Expand Down Expand Up @@ -293,11 +293,34 @@ end if
ib = ind(dNames.eq."ilev")
klev = dSizes(ia)
klevi = dSizes(ib)
; standard CAM dimensions
dimNames = (/"time", "lat", "lon", "lev", "ilev", "nbnd", "chars"/)
dimSizes = (/ -1 , nlat , mlon , klev, klevi , 2 , 8 /)
dimUnlim = (/ True , False, False, False, False , False , False /)
filedimdef(dst_file,dimNames,dimSizes,dimUnlim)
; cosp dimensions
if (any("cosp_scol".eq.dNames))
iscol = ind(dNames.eq."cosp_scol")
nscol = dSizes(iscol)
itau = ind(dNames.eq."cosp_tau")
ntau = dSizes(itau)
iprs = ind(dNames.eq."cosp_prs")
nprs = dSizes(iprs)
isr = ind(dNames.eq."cosp_sr")
nsr = dSizes(isr)
isza = ind(dNames.eq."cosp_sza")
nsza = dSizes(isza)
iht = ind(dNames.eq."cosp_ht")
nht = dSizes(iht)
; CAM dimensions plus cosp
dimNames = (/"time", "lat", "lon", "lev", "ilev", "nbnd", "chars","cosp_scol","cosp_prs","cosp_sr","cosp_tau","cosp_sza","cosp_ht"/)
dimSizes = (/ -1 , nlat , mlon , klev, klevi , 2 , 8 ,nscol ,nprs ,nsr ,ntau ,nsza ,nht /)
dimUnlim = (/ True , False, False, False, False , False , False ,False ,False ,False ,False ,False ,False /)
filedimdef(dst_file,dimNames,dimSizes,dimUnlim)
else
; standard CAM dimensions
dimNames = (/"time", "lat", "lon", "lev", "ilev", "nbnd", "chars"/)
dimSizes = (/ -1 , nlat , mlon , klev, klevi , 2 , 8 /)
dimUnlim = (/ True , False, False, False, False , False , False /)
filedimdef(dst_file,dimNames,dimSizes,dimUnlim)
end if



;--- The following are explicitly added because they are 'special'

Expand Down Expand Up @@ -332,6 +355,13 @@ end if
vdims = getfilevardims(src_file, var_in(nv))
filevardef(dst_file, var_in(nv), getfilevartypes(src_file,var_in(nv)) \
, (/ "time", vdims(1), "lat", "lon" /) )
delete(vdims)
end if
if (rank_in .eq.4.and.var_in(nv).eq."FISCCP1_COSP") then
vdims = getfilevardims(src_file, var_in(nv))
filevardef(dst_file, var_in(nv), getfilevartypes(src_file,var_in(nv)) \
, (/ "time", "cosp_prs", "cosp_tau","lat", "lon" /) )
delete(vdims)
end if

dumAtts = new( 1, getfilevartypes(src_file,var_in(nv)))
Expand Down Expand Up @@ -374,13 +404,13 @@ end if
any(var_in(nv).eq.var_in_copy) ) then

rank_in = dimsizes(getfilevardimsizes(src_file, var_in(nv)))

if (rank_in .eq.1 .or. any(var_in(nv).eq.var_in_copy) ) then
dst_file->$var_in(nv)$ = (/ src_file->$var_in(nv)$ /)
end if
if (rank_in .ge.2 .and. .not.any(var_in(nv).eq.var_in_copy)) then
dst_file->$var_in(nv)$ = (/ ESMF_regrid_with_weights(src_file->$var_in(nv)$,wgtFileName,Opt_RGRD) /)
end if
delete(rank_in)
end if
end if
end do ; nv
Expand Down

0 comments on commit 67d1b1b

Please sign in to comment.