CFU

CFU (Climate Fortran Utilities)

Several functions of the CFU package are need in the subchain scripts. CFU contains functions which are covered neither by CDO nor NCO functions .

add_hours

 

Purpose

add a number of hours to a date

Call

cfu add_hours < ystartdate > < hours > [< itype_calendar >]

Result

YYYYMMDDHH[mmss]

Meanings

ystartdate

has the form YYYYMMDDHH[mmss]

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)

add_lonlat

 

Purpose

adds 2D geographical latitude and longitude to a netCDF file containing rotated coordinates

Call

cfu add_lonlat < ncfile >

Result

< ncfile > with two additional 2D fields (lon and lat)

Meanings

ncfile

name of netCDF file to which the coordinates should be added

add_months

 

Purpose

add a number of hours to a date

Call

cfu add_months < ystartdate > < months >

Result

YYYYMMDDHH[mmss]

Meanings

ystartdate

has the form YYYYMMDDHH[mmss]

add_vertices

 

Purpose

adds geographical latitude and longitude vertices to a netCDF file

Call

cfu add_vertices < ncfile >

Result

< ncfile > with two additional fields (lon_bnds and lat_bnds) with the dimensions (4,lon,lat)

Meanings

ncfile

name 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

 

Purpose

check whether all required files in a date range are in a certain directory

Call

cfu check_files < ystartdate > < yenddate > < hh:mm:ss > < prefix12 > < prefix2 > < suffix >< input directory > < last output > [< itype_calendar >]

Result

0=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

 

 

 

 

 

ystartdate

start date in the form YYYYMMDDHH[mmss]

yenddate

end date the form YYYYMMDDHH[mmss]

hh:mm:ss

time increment of the files in the date range

prefix1

primary prefix to be checked (e.g. caf, laf, …), i.e. the characters preceding the YYYYMMDDHH[mmss] sequence

prefix2

secondary prefix to be checked (e.g. cas, lbfd, …), if prefix1 gives errors.In case only one prefix should be checked set prefix1=prefix2

suffix

suffix to be checked (e.g. .nc, c.nc, …), i.e. the characters following the YYYYMMDDHH[mmss] sequence

input directory

full path to directory holding the files to be checked

last output

should 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)