Skip to content

Commit 55e19b8

Browse files
cacraigucargoldy
authored and
goldy
committed
'Add nudging tools
Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/trunk@90332 Committed by Cheryl Craig <[email protected]> at 2018-12-11 17:28:25 -0700 Original svn commit message: Add nudging tools'
1 parent 9084c02 commit 55e19b8

35 files changed

+38659
-0
lines changed

doc/ChangeLog

+108
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,111 @@
1+
2+
===============================================================
3+
4+
Tag name:cam6_1_005
5+
Originator(s): patc, cacraig
6+
Date: Dec 11, 2018
7+
One-line Summary: Add nudging tools
8+
9+
Purpose of changes:
10+
- Add tools necessary for nudging
11+
12+
Bugs fixed (include bugzilla ID):
13+
14+
Describe any changes made to build system:
15+
16+
Describe any changes made to the namelist:
17+
18+
List any changes to the defaults for the boundary datasets:
19+
20+
Describe any substantial timing or memory changes:
21+
22+
Code reviewed by:
23+
24+
List all files eliminated:
25+
26+
List all files added and what they do:
27+
A components/cam/tools/nudging
28+
A components/cam/tools/nudging/Gen_Data
29+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore
30+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09
31+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Config
32+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Gen_ERAI_fv09_001.01.csh
33+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG
34+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.01
35+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.02
36+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.03
37+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.04
38+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.05
39+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.06
40+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.07
41+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.08
42+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.09
43+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.10
44+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.11
45+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90
46+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90-EXTEND
47+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90-ORIG
48+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.stub
49+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/OUTPUT
50+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/OUTPUT/2007
51+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Run_ERAI_fv09_001.01.csh
52+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP
53+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.01
54+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.02
55+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.03
56+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.04
57+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.05
58+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.06
59+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.07
60+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.08
61+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.09
62+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.10
63+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.11
64+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/crack_file_headers.ncl
65+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC.ncl
66+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_Create_field_Master_List.ncl
67+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_ERAI.csh
68+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_extract_analyses_info.ncl
69+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_procedures.ncl
70+
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/README
71+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore
72+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30
73+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Config
74+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Diag_plot.ncl
75+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/ESMF_regridding.ncl
76+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_ERAI_ne30-DIAG.csh
77+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_ERAI_ne30.csh
78+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_YOTC_ne120.csh
79+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/LOG
80+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/LOG/LOG_002.01
81+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/MAKEIC.f90
82+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/MAKEIC.stub
83+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/TMP
84+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/TMP/TMP_002.01
85+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_Create_field_Master_List.ncl
86+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_extract_analyses_info.ncl
87+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_001.ncl
88+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_002.ncl
89+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_procedures.ncl
90+
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/README
91+
A components/cam/tools/nudging/Lookat_NudgeWindow
92+
A components/cam/tools/nudging/Lookat_NudgeWindow/Example
93+
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/Example_HorizontalProfile.png
94+
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/Example_VerticalProfile.png
95+
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/user_nl_cam
96+
A components/cam/tools/nudging/Lookat_NudgeWindow/Lookat_NudgeWindow.ncl
97+
A components/cam/tools/nudging/Lookat_NudgeWindow/README
98+
A components/cam/tools/nudging/Lookat_NudgeWindow/Read_Namelist.f90
99+
A components/cam/tools/nudging/Lookat_NudgeWindow/Read_Namelist.stub
100+
A components/cam/tools/nudging/user_nl_cam-NUDGING_TEMPLATE
101+
102+
103+
List all existing files that have been modified, and describe the changes: None
104+
105+
106+
No testing was done, since this is just adding the nudging tool
107+
108+
===============================================================
1109
===============================================================
2110

3111
Tag name: cam6_1_004
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
#! /bin/csh -f
2+
3+
#---------------------------------------
4+
# Script to Generate ERA-I Nudging data
5+
#---------------------------------------
6+
7+
#===================================================================
8+
# CONFIGRATION SECTION:
9+
#===================================================================
10+
11+
# Set a REFERENCE (Starting) Date and the numbe rof days to process
12+
#-------------------------------------------------------------------
13+
set RUNNUM = 01
14+
set REF_DATE = '20090403'
15+
set NUM_DAYS = 240
16+
17+
# Set INPUT/OUTPUT/TMP directories,
18+
#-----------------------------------
19+
set NAMELIST = './Config/Config_makeIC-'$RUNNUM'.nl'
20+
set MYLOGDIR = './LOG/LOG_001.'$RUNNUM'/'
21+
set MYTMPDIR = './TMP/TMP_001.'$RUNNUM'/'
22+
set MYOUTDIR = '/glade/scratch/USER/inputdata/nudging/ERAI_fv09/'
23+
set INPUTDIR = '/glade2/collections/rda/data/ds627.0/'
24+
25+
26+
# Set Clean option
27+
#------------------------
28+
set TMP_clean = 'True'
29+
30+
# Set Processing options
31+
#------------------------
32+
set CASE = 'ERAI_fv09'
33+
set DYCORE = 'fv'
34+
set PRECISION = 'float'
35+
set VORT_DIV_TO_UV = 'True'
36+
set SST_MASK = 'False'
37+
set ICE_MASK = 'False'
38+
set OUTPUT_PHIS = 'True'
39+
set REGRID_ALL = 'False'
40+
set ADJUST_STATE_FROM_TOPO = 'True'
41+
42+
# Set files containig OUTPUT Grid structure and topography
43+
#---------------------------------------------------------
44+
set fname_grid_info = '/glade/p/cesm/cseg/inputdata/atm/cam/inic/fv/cami-mam3_0000-01-01_0.9x1.25_L30_c100618.nc'
45+
set fname_phis_output = '/glade/p/cesmdata/cseg/inputdata/atm/cam/topo/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_160505.nc'
46+
set ftype_phis_output = 'FV_TOPOGRAPHY'
47+
48+
# Set INPUT filename format, type of file, and number of time records per file
49+
#------------------------------------------------------------------------------
50+
set fname = ( none none none none none none )
51+
set ftype = ( none none none none none none )
52+
set ftime = ( none none none none none none )
53+
set hoursec = ( 00000 21600 43200 64800 )
54+
set hourstr = ( 00 06 12 18 )
55+
56+
set fname[1] = "ei.oper.an.ml/YYYYMM/ei.oper.an.ml.regn128sc.YYYYMMDDHH"
57+
set ftype[1] = "Era_Interim_627.0_sc"
58+
set ftime[1] = "1X"
59+
##set fname[2] = "ei.oper.an.sfc/YYYYMM/ei.oper.an.sfc.regn128sc.YYYYMMDDHH"
60+
##set ftype[2] = "Era_Interim_627.0_sc"
61+
##set ftime[2] = "1X"
62+
63+
# Set the OUTPUT fileds and the index of the file containing them
64+
#------------------------------------------------------------------
65+
set fields = ( U US V VS T Q PS )
66+
set field_findex = ( 1 1 1 1 1 1 1 )
67+
68+
# Set the index of the file containing the INPUT topography
69+
#------------------------------------------------------------------
70+
set phis_findex = 1
71+
72+
73+
#===================================================================
74+
# PROCESSING SECTION:
75+
# Loop over range of times,
76+
# generate inpute namelist for each time,
77+
# then generate the desired Nudging data
78+
#===================================================================
79+
80+
# Construct the fields string
81+
#-----------------------------
82+
set fieldstr = $fields[1]
83+
set jj = $field_findex[1]
84+
@ jj = $jj - 1
85+
set findexstr = $jj
86+
set ii = 1
87+
set fnum = $#fields
88+
while( $ii < $fnum )
89+
@ ii = $ii + 1
90+
set jj = $field_findex[$ii]
91+
@ jj = $jj - 1
92+
set fieldstr = `echo $fieldstr','$fields[$ii]`
93+
set findexstr = `echo $findexstr','$jj`
94+
end
95+
96+
set jj = $phis_findex
97+
@ jj = $jj - 1
98+
set phisstr = $jj
99+
100+
# Build NCL fortran library
101+
#---------------------------
102+
#/usr/local/bin/WRAPIT MAKEIC.stub MAKEIC.f90
103+
#/contrib/ncl-6.1.0/bin/WRAPIT MAKEIC.stub MAKEIC.f90
104+
WRAPIT MAKEIC.stub MAKEIC.f90
105+
106+
#
107+
# Loop over range of times to process
108+
# For the first time true, force
109+
# generation of ESMF weight datasets
110+
#=====================================
111+
set NDAYS = 0
112+
while ( $NDAYS < $NUM_DAYS )
113+
114+
# Set current time values
115+
#------------------------
116+
set Yearstr = "`date --date=$REF_DATE+${NDAYS}day +%Y`"
117+
set Monstr = "`date --date=$REF_DATE+${NDAYS}day +%m`"
118+
set Daystr = "`date --date=$REF_DATE+${NDAYS}day +%d`"
119+
echo $Yearstr ' / ' $Monstr ' / ' $Daystr
120+
121+
# Loop over the hourly values (4X daily)
122+
#========================================
123+
foreach hnum ( 1 2 3 4 )
124+
125+
# Set Values dependend upon $hnum, clean
126+
# up TMP files at the end of each DAY
127+
#----------------------------------------------------------------------
128+
set datestr = $Yearstr$Monstr$Daystr$hoursec[$hnum]
129+
set LOGFILE = $MYLOGDIR'/LogNCL.'$Yearstr$Monstr$Daystr$hoursec[$hnum]
130+
if( $hnum == 4 ) then
131+
set TMP_clean = 'True'
132+
else
133+
set TMP_clean = 'False'
134+
endif
135+
136+
# Create Namelist file for current time
137+
#----------------------------------------
138+
echo ' ' > $NAMELIST
139+
echo '! Generated Namelist for maekIC_se.ncl ' >> $NAMELIST
140+
echo '!------------------- ' >> $NAMELIST
141+
echo '&makeic_nl' >> $NAMELIST
142+
echo ' MYTMPDIR="'$MYTMPDIR'"' >> $NAMELIST
143+
echo ' MYOUTDIR="'$MYOUTDIR'"' >> $NAMELIST
144+
echo ' INPUTDIR="'$INPUTDIR'"' >> $NAMELIST
145+
echo ' ' >> $NAMELIST
146+
echo ' TMP_clean ="'$TMP_clean'"' >> $NAMELIST
147+
echo ' ' >> $NAMELIST
148+
echo ' REF_DATE ="'$REF_DATE'"' >> $NAMELIST
149+
echo ' CASE ="'$CASE'"' >> $NAMELIST
150+
echo ' DYCORE ="'$DYCORE'"' >> $NAMELIST
151+
echo ' PRECISION ="'$PRECISION'"' >> $NAMELIST
152+
echo ' VORT_DIV_TO_UV ="'$VORT_DIV_TO_UV'"' >> $NAMELIST
153+
echo ' SST_MASK ="'$SST_MASK'"' >> $NAMELIST
154+
echo ' ICE_MASK ="'$ICE_MASK'"' >> $NAMELIST
155+
echo ' OUTPUT_PHIS ="'$OUTPUT_PHIS'"' >> $NAMELIST
156+
echo ' REGRID_ALL ="'$REGRID_ALL'"' >> $NAMELIST
157+
echo ' ADJUST_STATE_FROM_TOPO="'$ADJUST_STATE_FROM_TOPO'"'>> $NAMELIST
158+
echo ' ' >> $NAMELIST
159+
echo ' fname_phis_output ="'$fname_phis_output'"' >> $NAMELIST
160+
echo ' ftype_phis_output ="'$ftype_phis_output'"' >> $NAMELIST
161+
echo ' fname_grid_info ="'$fname_grid_info'"' >> $NAMELIST
162+
echo ' ' >> $NAMELIST
163+
echo ' fields ="'$fieldstr'"' >> $NAMELIST
164+
echo ' source_files ="'$findexstr'"' >> $NAMELIST
165+
echo ' fname_phis_in='$phisstr >> $NAMELIST
166+
echo ' ' >> $NAMELIST
167+
set ii = 0
168+
set fnum = $#fname
169+
while( $ii < $fnum )
170+
set jj = $ii
171+
@ ii = $ii + 1
172+
set file = $fname[$ii]
173+
set file = `echo $file | sed 's/YYYY/'$Yearstr'/g'`
174+
set file = `echo $file | sed 's/MM/'$Monstr'/g'`
175+
set file = `echo $file | sed 's/DD/'$Daystr'/g'`
176+
if( $ftime[$ii] == "4X" ) then
177+
set file = `echo $file | sed 's/HH/'$hourstr[1]'/'`
178+
set file = `echo $file | sed 's/HH/'$hourstr[4]'/'`
179+
else
180+
set file = `echo $file | sed 's/HH/'$hourstr[$hnum]'/g'`
181+
endif
182+
echo " fname$jj="'"'$file'"' >> $NAMELIST
183+
end
184+
echo ' ' >> $NAMELIST
185+
set ii = 0
186+
set fnum = $#fname
187+
while( $ii < $fnum )
188+
set jj = $ii
189+
@ ii = $ii + 1
190+
echo " ftype$jj="'"'$ftype[$ii]'"' >> $NAMELIST
191+
end
192+
echo ' ' >> $NAMELIST
193+
set ii = 0
194+
set fnum = $#fname
195+
while( $ii < $fnum )
196+
set jj = $ii
197+
@ ii = $ii + 1
198+
if( $fname[$ii] == "none" ) then
199+
echo " fdate$jj="'"-1"' >> $NAMELIST
200+
else
201+
echo " fdate$jj="'"'$datestr'"' >> $NAMELIST
202+
endif
203+
end
204+
echo "/" >> $NAMELIST
205+
206+
# Execute NCL program to process the data
207+
#----------------------------------------
208+
cat $NAMELIST >& $LOGFILE.cfg
209+
ncl makeIC.ncl NameNumber=$RUNNUM >& $LOGFILE
210+
211+
# End Loop over the hourly values (4X daily)
212+
#===========================================
213+
end # foreach hnum ( 1 2 3 4 )
214+
215+
# End loop over time
216+
#=======================
217+
@ NDAYS = $NDAYS + 1
218+
end # while ( $NDAYS < $NUM_DAYS )
219+

0 commit comments

Comments
 (0)