Skip to content

Commit 392d1d9

Browse files
committed
Subject (<= 72 Characters)
Added orographic drag toolkit for topo generation. *********1*********2*********3*********4*********5*********6*********7** Longer commit message body describing the commit. Can contain lists as follows: * Item 1 * Item 2 * Item 3 A good commit message should be written like an email, a subject followed by a blank line, followed by a more descriptive body. Can also contain a tag at the bottom describing what type of commit this is. [BFB] - Bit-For-Bit [FCC] - Flag Climate Changing [Non-BFB] - Non Bit-For-Bit [CC] - Climate Changing [NML] - Namelist Changing See confluence for a more detailed description about these tags.
1 parent 74a116f commit 392d1d9

File tree

11 files changed

+8362
-0
lines changed

11 files changed

+8362
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
EXEDIR = .
2+
EXENAME = cube_to_target
3+
RM = rm
4+
5+
.SUFFIXES:
6+
.SUFFIXES: .F90 .o
7+
8+
FC = ifort
9+
DEBUG = FALSE
10+
11+
12+
# Check for the NetCDF library and include directories
13+
ifeq ($(LIB_NETCDF),$(null))
14+
LIB_NETCDF := /gpfs/fs1/soft/chrysalis/spack/opt/spack/linux-centos8-x86_64/intel-20.0.4/netcdf-fortran-4.4.4-rdxohvp/lib
15+
#/global/common/software/nersc/pm-2023q1/spack-stacks-1/views/climate-utils/lib
16+
#/public/software/mathlib/netcdf/4.3.2/intel/lib
17+
endif
18+
19+
ifeq ($(INC_NETCDF),$(null))
20+
INC_NETCDF := /gpfs/fs1/soft/chrysalis/spack/opt/spack/linux-centos8-x86_64/intel-20.0.4/netcdf-fortran-4.4.4-rdxohvp/include
21+
#/global/common/software/nersc/pm-2023q1/spack-stacks-1/views/climate-utils/include
22+
#/public/software/mathlib/netcdf/4.3.2/intel/include
23+
endif
24+
25+
# Determine platform
26+
UNAMES := $(shell uname -s)
27+
UNAMEM := $(findstring CRAY,$(shell uname -m))
28+
29+
#------------------------------------------------------------------------
30+
# LF95
31+
#------------------------------------------------------------------------
32+
#
33+
# setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/netcdf-4.1.3-gcc-4.4.4-13-lf9581/lib
34+
#
35+
ifeq ($(FC),lf95)
36+
#
37+
# Tramhill
38+
#
39+
INC_NETCDF :=/usr/local/netcdf-4.1.3-gcc-4.4.4-13-lf9581/include
40+
LIB_NETCDF :=/usr/local/netcdf-4.1.3-gcc-4.4.4-13-lf9581/lib
41+
42+
LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lcurl -lhdf5 -lhdf5_hl -mcmodel=medium
43+
FFLAGS := -c --trace --trap --wide -CcdRR8 -I$(INC_NETCDF)
44+
ifeq ($(DEBUG),TRUE)
45+
# FFLAGS += --chk aesu -Cpp --trace
46+
FFLAGS += -g --chk a,e,s,u --pca
47+
else
48+
FFLAGS += -O
49+
endif
50+
51+
endif
52+
53+
54+
55+
.F90.o:
56+
$(FC) $(FFLAGS) $<
57+
58+
59+
#------------------------------------------------------------------------
60+
# AIX
61+
# #------------------------------------------------------------------------
62+
#
63+
#ifeq ($(UNAMES),AIX)
64+
FC = ifort #xlf90
65+
#FFLAGS = -c -I$(INC_NETCDF) -I/BIGDATA1/iapcas_mhzhang_xiejinbo/topo_tool/cube_to_target/functional/ -convert big_endian
66+
67+
FFLAGS = -c -I$(INC_NETCDF) -convert big_endian -traceback
68+
#FFLAGS := -c -I$(INC_NETCDF) -no-prec-div -traceback -convert big_endian -fp-model source -assume byterecl -ftz -m64 -mcmodel=large -safe-cray-ptr
69+
LDFLAGS = -L$(LIB_NETCDF) -lnetcdff
70+
#LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -m64 -static-intel
71+
.F90.o:
72+
$(FC) $(FFLAGS) -qsuffix=f=F90 $<
73+
# #endif
74+
75+
76+
.F90.o:
77+
$(FC) $(FFLAGS) $<
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
#------------------------------------------------------------------------
89+
# Default rules and macros
90+
#------------------------------------------------------------------------
91+
92+
#OBJS := reconstruct.o remap.o cube_to_target.o shr_kind_mod.o
93+
OBJS := reconstruct.o remap.o shr_kind_mod.o transform.o sub_xjb.o cube_to_target.o
94+
#OBJS := reconstruct.o remap.o cube_to_target.o sub.o shr_kind_mod.o
95+
#sub.o shr_kind_mod.o
96+
97+
$(EXEDIR)/$(EXENAME): $(OBJS)
98+
$(FC) -o $@ $(OBJS) -I$(INC_NETCDF) $(LDFLAGS)
99+
100+
clean:
101+
$(RM) -f $(OBJS) *.mod $(EXEDIR)/$(EXENAME)
102+
103+
cube_to_target.o: shr_kind_mod.o remap.o reconstruct.o sub_xjb.o transform.o
104+
remap.o:
105+
reconstruct.o: remap.o
106+
#reconstruct.o : shr_kind_mod.o
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cube_to_target performs rigourous remapping of topo variables from cubed-sphere grid to
2+
any target grid. In the process SGH is computed.
3+
4+
Input files:
5+
6+
1. USGS-topo-cube.nc (may be found here $CESMDATA/inputdata/atm/cam/hrtopo/USGS-topo-cube3000.nc)
7+
8+
This is the topo data on a cubed-sphere (default is 3km cubed-sphere grid)
9+
10+
2. target.nc (e.g., $CESMDATA/inputdata/atm/cam/grid-description/se/ne30np4_091226_pentagons.nc)
11+
12+
This is a SCRIP/ESMF grid descriptor file for the target grid
13+
14+
3. phis-smooth.nc
15+
16+
(optional) The user may provide a smoothed PHIS field. The software then recomputes SGH to
17+
account for the smoothing in the sub-grid-scale.
18+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh
4+
tempest_root=~/.conda/envs/jinbo
5+
# Generate the element mesh.
6+
${tempest_root}/bin/GenerateCSMesh --alt --res 30 --file topo2/ne30.g
7+
# Generate the target physgrid mesh.
8+
${tempest_root}/bin/GenerateVolumetricMesh --in topo2/ne30.g --out topo2/ne30pg2.g --np 2 --uniform
9+
# Generate a high-res target physgrid mesh for cube_to_target.
10+
${tempest_root}/bin/GenerateVolumetricMesh --in topo2/ne30.g --out topo2/ne30pg4.g --np 4 --uniform
11+
# Generate SCRIP files for cube_to_target.
12+
${tempest_root}/bin/ConvertMeshToSCRIP --in topo2/ne30pg4.g --out topo2/ne30pg4_scrip.nc
13+
${tempest_root}/bin/ConvertMeshToSCRIP --in topo2/ne30pg2.g --out topo2/ne30pg2_scrip.nc

0 commit comments

Comments
 (0)