Skip to content

Commit

Permalink
'Add nudging tools
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
cacraigucar authored and goldy committed Oct 3, 2019
1 parent 9084c02 commit 55e19b8
Show file tree
Hide file tree
Showing 35 changed files with 38,659 additions and 0 deletions.
108 changes: 108 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,111 @@

===============================================================

Tag name:cam6_1_005
Originator(s): patc, cacraig
Date: Dec 11, 2018
One-line Summary: Add nudging tools

Purpose of changes:
- Add tools necessary for nudging

Bugs fixed (include bugzilla ID):

Describe any changes made to build system:

Describe any changes made to the namelist:

List any changes to the defaults for the boundary datasets:

Describe any substantial timing or memory changes:

Code reviewed by:

List all files eliminated:

List all files added and what they do:
A components/cam/tools/nudging
A components/cam/tools/nudging/Gen_Data
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Config
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Gen_ERAI_fv09_001.01.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.01
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.02
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.03
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.04
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.05
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.06
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.07
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.08
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.09
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.10
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/LOG/LOG_001.11
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90-EXTEND
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.f90-ORIG
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/MAKEIC.stub
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/OUTPUT
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/OUTPUT/2007
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/Run_ERAI_fv09_001.01.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.01
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.02
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.03
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.04
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.05
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.06
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.07
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.08
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.09
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.10
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/TMP/TMP_001.11
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/crack_file_headers.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_Create_field_Master_List.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_ERAI.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_extract_analyses_info.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/Gen_Data_SETNAME_f09/makeIC_procedures.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_FVdycore/README
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Config
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Diag_plot.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/ESMF_regridding.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_ERAI_ne30-DIAG.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_ERAI_ne30.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/Gen_YOTC_ne120.csh
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/LOG
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/LOG/LOG_002.01
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/MAKEIC.f90
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/MAKEIC.stub
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/TMP
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/TMP/TMP_002.01
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_Create_field_Master_List.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_extract_analyses_info.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_001.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_002.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/Gen_Data_SETNAME_ne30/makeIC_se_procedures.ncl
A components/cam/tools/nudging/Gen_Data/Gen_Data_SEdycore/README
A components/cam/tools/nudging/Lookat_NudgeWindow
A components/cam/tools/nudging/Lookat_NudgeWindow/Example
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/Example_HorizontalProfile.png
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/Example_VerticalProfile.png
A components/cam/tools/nudging/Lookat_NudgeWindow/Example/user_nl_cam
A components/cam/tools/nudging/Lookat_NudgeWindow/Lookat_NudgeWindow.ncl
A components/cam/tools/nudging/Lookat_NudgeWindow/README
A components/cam/tools/nudging/Lookat_NudgeWindow/Read_Namelist.f90
A components/cam/tools/nudging/Lookat_NudgeWindow/Read_Namelist.stub
A components/cam/tools/nudging/user_nl_cam-NUDGING_TEMPLATE


List all existing files that have been modified, and describe the changes: None


No testing was done, since this is just adding the nudging tool

===============================================================
===============================================================

Tag name: cam6_1_004
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
#! /bin/csh -f

#---------------------------------------
# Script to Generate ERA-I Nudging data
#---------------------------------------

#===================================================================
# CONFIGRATION SECTION:
#===================================================================

# Set a REFERENCE (Starting) Date and the numbe rof days to process
#-------------------------------------------------------------------
set RUNNUM = 01
set REF_DATE = '20090403'
set NUM_DAYS = 240

# Set INPUT/OUTPUT/TMP directories,
#-----------------------------------
set NAMELIST = './Config/Config_makeIC-'$RUNNUM'.nl'
set MYLOGDIR = './LOG/LOG_001.'$RUNNUM'/'
set MYTMPDIR = './TMP/TMP_001.'$RUNNUM'/'
set MYOUTDIR = '/glade/scratch/USER/inputdata/nudging/ERAI_fv09/'
set INPUTDIR = '/glade2/collections/rda/data/ds627.0/'


# Set Clean option
#------------------------
set TMP_clean = 'True'

# Set Processing options
#------------------------
set CASE = 'ERAI_fv09'
set DYCORE = 'fv'
set PRECISION = 'float'
set VORT_DIV_TO_UV = 'True'
set SST_MASK = 'False'
set ICE_MASK = 'False'
set OUTPUT_PHIS = 'True'
set REGRID_ALL = 'False'
set ADJUST_STATE_FROM_TOPO = 'True'

# Set files containig OUTPUT Grid structure and topography
#---------------------------------------------------------
set fname_grid_info = '/glade/p/cesm/cseg/inputdata/atm/cam/inic/fv/cami-mam3_0000-01-01_0.9x1.25_L30_c100618.nc'
set fname_phis_output = '/glade/p/cesmdata/cseg/inputdata/atm/cam/topo/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_160505.nc'
set ftype_phis_output = 'FV_TOPOGRAPHY'

# Set INPUT filename format, type of file, and number of time records per file
#------------------------------------------------------------------------------
set fname = ( none none none none none none )
set ftype = ( none none none none none none )
set ftime = ( none none none none none none )
set hoursec = ( 00000 21600 43200 64800 )
set hourstr = ( 00 06 12 18 )

set fname[1] = "ei.oper.an.ml/YYYYMM/ei.oper.an.ml.regn128sc.YYYYMMDDHH"
set ftype[1] = "Era_Interim_627.0_sc"
set ftime[1] = "1X"
##set fname[2] = "ei.oper.an.sfc/YYYYMM/ei.oper.an.sfc.regn128sc.YYYYMMDDHH"
##set ftype[2] = "Era_Interim_627.0_sc"
##set ftime[2] = "1X"

# Set the OUTPUT fileds and the index of the file containing them
#------------------------------------------------------------------
set fields = ( U US V VS T Q PS )
set field_findex = ( 1 1 1 1 1 1 1 )

# Set the index of the file containing the INPUT topography
#------------------------------------------------------------------
set phis_findex = 1


#===================================================================
# PROCESSING SECTION:
# Loop over range of times,
# generate inpute namelist for each time,
# then generate the desired Nudging data
#===================================================================

# Construct the fields string
#-----------------------------
set fieldstr = $fields[1]
set jj = $field_findex[1]
@ jj = $jj - 1
set findexstr = $jj
set ii = 1
set fnum = $#fields
while( $ii < $fnum )
@ ii = $ii + 1
set jj = $field_findex[$ii]
@ jj = $jj - 1
set fieldstr = `echo $fieldstr','$fields[$ii]`
set findexstr = `echo $findexstr','$jj`
end

set jj = $phis_findex
@ jj = $jj - 1
set phisstr = $jj

# Build NCL fortran library
#---------------------------
#/usr/local/bin/WRAPIT MAKEIC.stub MAKEIC.f90
#/contrib/ncl-6.1.0/bin/WRAPIT MAKEIC.stub MAKEIC.f90
WRAPIT MAKEIC.stub MAKEIC.f90

#
# Loop over range of times to process
# For the first time true, force
# generation of ESMF weight datasets
#=====================================
set NDAYS = 0
while ( $NDAYS < $NUM_DAYS )

# Set current time values
#------------------------
set Yearstr = "`date --date=$REF_DATE+${NDAYS}day +%Y`"
set Monstr = "`date --date=$REF_DATE+${NDAYS}day +%m`"
set Daystr = "`date --date=$REF_DATE+${NDAYS}day +%d`"
echo $Yearstr ' / ' $Monstr ' / ' $Daystr

# Loop over the hourly values (4X daily)
#========================================
foreach hnum ( 1 2 3 4 )

# Set Values dependend upon $hnum, clean
# up TMP files at the end of each DAY
#----------------------------------------------------------------------
set datestr = $Yearstr$Monstr$Daystr$hoursec[$hnum]
set LOGFILE = $MYLOGDIR'/LogNCL.'$Yearstr$Monstr$Daystr$hoursec[$hnum]
if( $hnum == 4 ) then
set TMP_clean = 'True'
else
set TMP_clean = 'False'
endif

# Create Namelist file for current time
#----------------------------------------
echo ' ' > $NAMELIST
echo '! Generated Namelist for maekIC_se.ncl ' >> $NAMELIST
echo '!------------------- ' >> $NAMELIST
echo '&makeic_nl' >> $NAMELIST
echo ' MYTMPDIR="'$MYTMPDIR'"' >> $NAMELIST
echo ' MYOUTDIR="'$MYOUTDIR'"' >> $NAMELIST
echo ' INPUTDIR="'$INPUTDIR'"' >> $NAMELIST
echo ' ' >> $NAMELIST
echo ' TMP_clean ="'$TMP_clean'"' >> $NAMELIST
echo ' ' >> $NAMELIST
echo ' REF_DATE ="'$REF_DATE'"' >> $NAMELIST
echo ' CASE ="'$CASE'"' >> $NAMELIST
echo ' DYCORE ="'$DYCORE'"' >> $NAMELIST
echo ' PRECISION ="'$PRECISION'"' >> $NAMELIST
echo ' VORT_DIV_TO_UV ="'$VORT_DIV_TO_UV'"' >> $NAMELIST
echo ' SST_MASK ="'$SST_MASK'"' >> $NAMELIST
echo ' ICE_MASK ="'$ICE_MASK'"' >> $NAMELIST
echo ' OUTPUT_PHIS ="'$OUTPUT_PHIS'"' >> $NAMELIST
echo ' REGRID_ALL ="'$REGRID_ALL'"' >> $NAMELIST
echo ' ADJUST_STATE_FROM_TOPO="'$ADJUST_STATE_FROM_TOPO'"'>> $NAMELIST
echo ' ' >> $NAMELIST
echo ' fname_phis_output ="'$fname_phis_output'"' >> $NAMELIST
echo ' ftype_phis_output ="'$ftype_phis_output'"' >> $NAMELIST
echo ' fname_grid_info ="'$fname_grid_info'"' >> $NAMELIST
echo ' ' >> $NAMELIST
echo ' fields ="'$fieldstr'"' >> $NAMELIST
echo ' source_files ="'$findexstr'"' >> $NAMELIST
echo ' fname_phis_in='$phisstr >> $NAMELIST
echo ' ' >> $NAMELIST
set ii = 0
set fnum = $#fname
while( $ii < $fnum )
set jj = $ii
@ ii = $ii + 1
set file = $fname[$ii]
set file = `echo $file | sed 's/YYYY/'$Yearstr'/g'`
set file = `echo $file | sed 's/MM/'$Monstr'/g'`
set file = `echo $file | sed 's/DD/'$Daystr'/g'`
if( $ftime[$ii] == "4X" ) then
set file = `echo $file | sed 's/HH/'$hourstr[1]'/'`
set file = `echo $file | sed 's/HH/'$hourstr[4]'/'`
else
set file = `echo $file | sed 's/HH/'$hourstr[$hnum]'/g'`
endif
echo " fname$jj="'"'$file'"' >> $NAMELIST
end
echo ' ' >> $NAMELIST
set ii = 0
set fnum = $#fname
while( $ii < $fnum )
set jj = $ii
@ ii = $ii + 1
echo " ftype$jj="'"'$ftype[$ii]'"' >> $NAMELIST
end
echo ' ' >> $NAMELIST
set ii = 0
set fnum = $#fname
while( $ii < $fnum )
set jj = $ii
@ ii = $ii + 1
if( $fname[$ii] == "none" ) then
echo " fdate$jj="'"-1"' >> $NAMELIST
else
echo " fdate$jj="'"'$datestr'"' >> $NAMELIST
endif
end
echo "/" >> $NAMELIST

# Execute NCL program to process the data
#----------------------------------------
cat $NAMELIST >& $LOGFILE.cfg
ncl makeIC.ncl NameNumber=$RUNNUM >& $LOGFILE

# End Loop over the hourly values (4X daily)
#===========================================
end # foreach hnum ( 1 2 3 4 )

# End loop over time
#=======================
@ NDAYS = $NDAYS + 1
end # while ( $NDAYS < $NUM_DAYS )

Loading

0 comments on commit 55e19b8

Please sign in to comment.