Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

CFU (Climate Fortran Utilities)

The CFU package need to be compiled for the subchain scripts. CFU contains several functions that are not covered by neither CDO nor NCO functions.


 add_hours

add_hours

Purposeadd a number of hours to a date
Callcfu add_hours <ystartdate> <hours> [<itype_calendar>]
ResultYYYYMMDDHH[mmss]
Meaningsystartdatehas the form YYYYMMDDHH[mmss]
itype_calendar0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)
2  = climatological calendar (365 days per year)
 add_lonlat

add_lonlat

Purposeadds 2D geographical latitude and longitude to a netCDF file containing rotated coordinates
Callcfu add_lonlat <ncfile>
Result<ncfile> with two additional 2D fields (lon and lat)
Meaningsncfilename of netCDF file to which the coordinates should be added
 add_months

add_months

Purposeadd a number of hours to a date
Callcfu add_months <ystartdate> <months>
ResultYYYYMMDDHH[mmss]
Meaningsystartdatehas the form YYYYMMDDHH[mmss]
 add_vertices

add_vertices

Purposeadds geographical latitude and longitude vertices to a netCDF file
Callcfu add_vertices <ncfile>
Result<ncfile> with two additional fields (lon_bnds and lat_bnds) with the dimensions (4,lon,lat)
Meaningsncfilename of netCDF file to which the vertices should be added
Remark

The counting of the 4 vertices goes like this

4 --- 3
|     |
1 --- 2
 check_files

check_files

Purposecheck whether all required files in a date range are in a certain directory
Callcfu check_files <ystartdate> <yenddate> <hh:mm:ss> <prefix12> <prefix2> <suffix><input directory> <last output> [<itype_calendar>]
Result0=success, 1=error. In case of error the file check_files.log contains the names of the missing files. The file check_files.log is written to the directory where the program check_files is called.
Meanings







ystartdatestart date in the form YYYYMMDDHH[mmss]
yenddateend date the form YYYYMMDDHH[mmss]
hh:mm:sstime increment of the files in the date range
prefix1primary prefix to be checked (e.g. caf, laf, …), i.e. the characters preceding the YYYYMMDDHH[mmss] sequence
prefix2secondary prefix to be checked (e.g. cas, lbfd, …), if prefix1 gives errors.In case only one prefix should be checked set prefix1=prefix2
suffixsuffix to be checked (e.g. .nc, c.nc, …), i.e. the characters following the YYYYMMDDHH[mmss] sequence
input directoryfull path to directory holding the files to be checked
last outputshould be set to true T in case the yenddate should be included in the check, otherwise it should be set to false F
itype_calendar

0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)
2  = climatological calendar (365 days per year)

 check_files_iso

check_files_iso

Purposecheck whether all required files in a date range are in a certain directory (uses ISO time stamp: YYYYMMDDHHTmmssZ)
Callcfu check_files_iso <ystartdate> <yenddate> <hh:mm:ss> <prefix12> <prefix2> <suffix><input directory> <last output> [<itype_calendar>]
Result0=success, 1=error. In case of error the file check_files.log contains the names of the missing files. The file check_files.log is written to the directory where the program check_files_iso is called.
Meanings







ystartdatestart date in the form YYYYMMDDHHmmss
yenddateend date the form YYYYMMDDHHmmss
hh:mm:sstime increment of the files in the date range
prefix1primary prefix to be checked (e.g. caf, laf, …), i.e. the characters preceding the YYYYMMDDHH[mmss] sequence
prefix2secondary prefix to be checked (e.g. cas, lbfd, …), if prefix1 gives errors.In case only one prefix should be checked set prefix1=prefix2
suffixsuffix to be checked (e.g. .nc, c.nc, …), i.e. the characters following the YYYYMMDDHHTmmssZ sequence
input directoryfull path to directory holding the files to be checked
last outputshould be set to true T in case the yenddate should be included in the check, otherwise it should be set to false F
itype_calendar

0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)
2  = climatological calendar (365 days per year)

 get_attval

get_attval

Purposeget the value of an attribute 
Callcfu get_attval <ncfile> <varname> <attribute name>
Resultvalue of the attribute or -- in case the attribute is not found  
Meaningsncfilename of the netCDF file
varnamename of the variable with the requested attribute
attribute namename of the attribute
 get_hours

get_hours

Purposedetermine the number of hours between two dates
Callcfu get_hours <ystartdate><enddate> [<itype_calendar>]
Resultnumber of hours
Meaningsystartdatestart date in the form the form YYYYMMDDHH[mmss]

yenddateend date in the form the form YYYYMMDDHH[mmss]

itype_calendar0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)

2  = climatological calendar (365 days per year)
 get_next_dates

get_next_dates

Purposedetermines the next two dates for a given time increment
Callcfu get_next_dates <ystartdate><MM:DD:HH[:mm:ss]> [<itype_calendar>]
ResultYYYYMMDDHH[mmss]YYYYMMDDHH[mmss]
Meaningsystartdatestartdate in the form YYYYMMDDHH[mmss] 

MM:DD:HH[:mm:ss]time increment

itype_calendar0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)

2  = climatological calendar (365 days per year)
Remarkpresently this function is especially for calculating the next dates when running the CCLM in the subchain. This includes a restriction of maximum 28 for DD. Note that the DD restriction only applies for sub monthly chunks.
 get_prev_date

get_next_date

Purposedetermines the previous two dates for a given time increment
Callcfu get_prev_date <ystartdate><MM:DD:HH[:mm:ss]> [<itype_calendar>]
ResultYYYYMMDDHH
Meaningsystartdatestartdate in the form YYYYMMDDHH[mmss] 

MM:DD:HH[:mm:ss]time increment

itype_calendar0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)

2  = climatological calendar (365 days per year)
RemarkPresently this version takes monthly intervals only.
itype_calendar is not used in this version.
 icon_domain

icon_domain

Purposeprovide helpful input for the  ICON Grid Generator + ExtPar Web Frontend 
Callcfu icon_domain <input file> <nbound>
Result

an example output looks as follows

 write parent grid: (tick box)
center: longitude (degrees)   -5.11000
center: latitude (degrees)    -0.77000
half width:    24.42000
half height:   23.76000
 rotate: (tick box) 
north pole: longitude (degrees) -162.00000   latitude (degrees)   39.25000
Meaningsinput fileFile that contains the rotated coordinates of the domain to which the ICON results in the post processing script of SPICE will be remapped

nboundNumber of grid point by which the domain given by the input file is extended. This is to keep the rotated domain out of the boundary zone of the regional ICON
 shellpp

shellpp

Purpose"precompiles" a shell script
Callcfu shellpp <input file> <output file> <name>
Resultprecompiled file output file
Meaningsinput fileinput file containing the precompile commands

output file"precompiled" output file

namename of the ifdef clauses that should be used
Remark

This is a very rudimentary pre-compiler version like the one for e.g. FORTRAN programs. It can only handle the two commands:
#ifdef name
#endif

If you are interested in a more sophisticated bash pre-processor please check the one on bashpp GitHub. 

 tbtimestamp

tbtimestamp

PurposePrints the time stamp of the time bounds variable time_bnds
Callcfu tbtimestamp <input file> [<itype_calendar>]
ResultYYYY-MM-DDThh:mm:ss as loop over bounds (=2) and time steps
Meaningsinput file File containing the time bounds 

itype_calendar0 = 365 days (plus taking into account for leap years) a year
1  = climatological calendar (360 days per year)

2  = climatological calendar (365 days per year)
  • No labels