stateToColumn_mod

link to source code

Dependency Diagrams:

stateToColumn_mod.svg

Direct Dependency Diagram

stateToColumn_mod_rev.svg

Reverse Dependency Diagram

Description

MODULE stateToColumn_mod (prefix=’s2c’ category=’4. Data Object transformations’)

Purpose

Non-linear, tangent-linear and adjoint versions of horizontal-temporal interpolation between a gridStateVector object and a columnData object.

Quick access

Types

struct_interpinfo, struct_stepprocdata

Routines

checkcolumnstatevectormatch(), gettovsfootprintradius(), latlonchecks(), latlonchecksanlgrid(), myezsint_ad(), myezsint_nl(), myezsint_r8_nl(), myezsint_tl(), myezuvint_ad(), myezuvint_nl(), myezuvint_tl(), pressureprofilemonotonicitycheck(), s2c_ad(), s2c_bgcheck_bilin(), s2c_deallocinterpinfo(), s2c_getfootprintradius(), s2c_getweightsandgridpointindexes(), s2c_nl(), s2c_rejectzeroweightobs(), s2c_setupbilinearinterp(), s2c_setupfootprintinterp(), s2c_setuphorizinterp(), s2c_setupinterpinfo(), s2c_setuplakeinterp(), s2c_setupnearestneighbor(), s2c_tl()

Needed modules

  • mathphysconstants_mod: MODULE mathPhysConstants_mod (prefix=’mpc’ category=’8. Low-level utilities and constants’)

  • earthconstants_mod: MODULE earthConstants_mod (prefix=’ec’ category=’8. Low-level utilities and constants’)

  • mpi (mpi_status_size())

  • midasmpi_mod: MODULE midasMpi_mod (prefix=’mmpi’ category=’8. Low-level utilities and constants’)

  • codeprecision_mod: MODULE codePrecision_mod (prefix=’pre’ category=’8. Low-level utilities and constants’)

  • gridstatevector_mod: MODULE gridStateVector_mod (prefix=’gsv’ category=’6. High-level data objects’)

  • obsspacedata_mod: MODULE obsSpaceData_mod (prefix=’obs’ category=’6. High-level data objects’)

  • columndata_mod: MODULE columnData_mod (prefix=’col’ category=’6. High-level data objects’)

  • horizontalcoord_mod: MODULE horizontalCoord_mod (prefix=’hco’ category=’7. Low-level data objects’)

  • obstimeinterp_mod: MODULE obsTimeInterp_mod (prefix=’oti’ category=’4. Data Object transformations’)

  • windrotation_mod: MODULE windRotation_mod (prefix=’uvr’ category=’4. Data Object transformations’)

  • utilities_mod: MODULE utilities_mod (prefix=’utl’ category=’8. Low-level utilities and constants’)

  • gridvariabletransforms_mod: MODULE gridVariableTransforms_mod (prefix=’gvt’ category=’4. Data Object transformations’)

  • varnamelist_mod: MODULE varNameList_mod (prefix=’vnl’ category=’7. Low-level data objects’)

  • slantprofilelatlon_mod: MODULE slantProfileLatLon_mod (prefix=’slp’ category=’5. Observation operators’)

  • tovsnl_mod: MODULE tovsNL_mod (prefix=’tvs’ category=’5. Observation operators’)

  • codtyp_mod: MODULE codtyp_mod (prefix=’codtyp’ category=’8. Low-level utilities and constants’)

  • getgridposition_mod: MODULE getGridPosition_mod (prefix=’gpos’ category=’8. Low-level utilities and constants’)

  • kdtree2_mod: MODULE kdTree2_mod (prefix=’kdtree2’ category=’8. Low-level utilities and constants’)

  • calcheightandpressure_mod: MODULE calcHeightAndPressure_mod (prefix=’czp’ category=’4. Data Object transformations’)

  • humiditylimits_mod: MODULE humidityLimits_mod (prefix=’qlim’ category=’4. Data Object transformations’)

Types

  • type  statetocolumn_mod/struct_stepprocdata

    lat-lon location of observations to be interpolated

    Type fields
    • % allheaderindex (*) [integer ,pointer]

    • % alllat (*,*) [real ,pointer]

    • % alllatrot (*,*,*) [real ,pointer]

    • % alllon (*,*) [real ,pointer]

    • % alllonrot (*,*,*) [real ,pointer]

    • % depotindexbeg (*,*,*) [integer ,pointer]

    • % depotindexend (*,*,*) [integer ,pointer]

    • % null [real ,pointer]

  • type  statetocolumn_mod/struct_interpinfo
    Type fields
    • % allnumheaderused (*,*) [integer ,pointer]

    • % hco [struct_hco ,pointer]

    • % initialized [logical ]

    • % inputstatevectortype [character ]

    • % interpweightdepot (*) [real ,allocatable] :: (depotIndex)

    • % latindexdepot (*) [integer ,pointer] :: (depotIndex)

    • % lonindexdepot (*) [integer ,pointer] :: (depotIndex)

    • % null [struct_hco ,pointer]

    • % oti [struct_oti ,pointer]

    • % stepprocdata (*,*) [struct_stepprocdata ,allocatable] :: (proc, step)

    • % uvr [struct_uvr ,pointer]

Variables

Subroutines and functions

subroutine  statetocolumn_mod/pressureprofilemonotonicitycheck(obsspacedata, column)
Purpose

Check for non monotonic pressure profiles that can be computed in slantpathmode

Arguments
  • obsspacedata [struct_obs ,inout]

  • column [struct_columndata ,inout]

Called from

s2c_tl(), s2c_ad(), s2c_nl()

Call to

obs_getheaderindex(), col_getcolumn(), utl_abort(), obs_headset_i(), obs_headelem_i(), obs_bodyset_i(), obs_bodyelem_i()

subroutine  statetocolumn_mod/latlonchecksanlgrid(obsspacedata, hco_core, moveobsatpole)
Purpose

Check the lat/lon of observations and modify if necessary

Arguments
  • obsspacedata [struct_obs ,inout]

  • hco_core [struct_hco ,in,pointer]

  • moveobsatpole [logical ,in]

Called from

s2c_nl()

Call to

obs_numheader(), obs_headelem_r(), gpos_getpositionxy(), obs_headelem_i(), obs_bodyset_i(), obs_headset_i()

subroutine  statetocolumn_mod/s2c_setupinterpinfo(interpinfo, obsspacedata, statevector, headerindexbeg, headerindexend, timeinterptype, rejectoutsideobs, inputstatevectortype[, lastcall_opt])
Purpose

Setup all of the information needed to quickly perform the horizontal interpolation to the observation locations.

Arguments
  • interpinfo [struct_interpinfo ,out]

  • obsspacedata [struct_obs ,inout]

  • statevector [struct_gsv ,in,target] :: IN

  • headerindexbeg [integer ,in]

  • headerindexend [integer ,in]

  • timeinterptype [character ,in]

  • rejectoutsideobs [logical ,in] :: IN

  • inputstatevectortype [character ,in]

Options

lastcall_opt [logical ,in,]

Called from

s2c_tl(), s2c_ad(), s2c_nl()

Call to

utl_isnamelistpresent(), utl_abort(), oti_setup(), oti_gettimeinterpweight(), gsv_varexist(), uvr_setup(), gsv_getnumlev(), gsv_isallocated(), gsv_varnameslist(), gsv_allocate(), gsv_transposevarslevstotiles(), gsv_deallocate(), gvt_getstatevectortrial(), utl_tmg_start(), gsv_transposetilestompiglobal(), utl_tmg_stop(), s2c_getfootprintradius(), obs_headelem_r(), obs_headelem_i(), tvs_isidburptovs(), slp_calclatlontovs(), codtyp_get_codtyp(), slp_calclatlonro(), slp_calclatlonradar(), latlonchecks(), gsv_getlevfromk(), vnl_varlevelfromvarname(), gsv_getvarnamefromk(), kdtree2_3dposition(), kdtree2_create(), gpos_getpositionxy(), uvr_rotatelatlon(), s2c_setuphorizinterp(), s2c_rejectzeroweightobs(), kdtree2_destroy()

subroutine  statetocolumn_mod/s2c_tl(statevector_in, columnanlinc, columntrlonanlinclev, obsspacedata)
Purpose

Tangent linear version of the horizontal interpolation, used for the increment (or perturbations).

Arguments
  • statevector_in [struct_gsv ,in,target]

  • columnanlinc [struct_columndata ,inout]

  • columntrlonanlinclev [struct_columndata ,inout]

  • obsspacedata [struct_obs ,inout]

Called from

aer_analysiserror(), aer_dayssincelastobs(), fso_ensemble(), simvar(), osd_calcinflation(), ose_compute_hbht_ensemble(), midas_diaghbht

Call to

utl_tmg_start(), gsv_isallocated(), utl_abort(), hco_equal(), s2c_deallocinterpinfo(), checkcolumnstatevectormatch(), gsv_allocate(), gsv_getdatakind(), gsv_copy(), gsv_varnameslist(), gsv_transposetilestovarslevs(), obs_numheader(), utl_tmg_stop(), s2c_setupinterpinfo(), col_getallcolumns(), gsv_getvarnamefromk(), myezuvint_tl(), myezsint_tl(), oti_gettimeinterpweightmpiglobal(), gsv_getlevfromk(), gsv_deallocate(), pressureprofilemonotonicitycheck()

subroutine  statetocolumn_mod/s2c_ad(statevector_out, columnanlinc, columntrlonanlinclev, obsspacedata)
Purpose

Adjoint version of the horizontal interpolation, used for the cost function gradient with respect to the increment.

Arguments
  • statevector_out [struct_gsv ,inout,target]

  • columnanlinc [struct_columndata ,inout]

  • columntrlonanlinclev [struct_columndata ,inout]

  • obsspacedata [struct_obs ,inout]

Called from

simvar()

Call to

utl_tmg_start(), gsv_isallocated(), utl_abort(), hco_equal(), s2c_deallocinterpinfo(), gsv_allocate(), gsv_getdatakind(), gsv_varnameslist(), gsv_zero(), obs_numheader(), utl_tmg_stop(), s2c_setupinterpinfo(), col_getallcolumns(), gsv_getvarnamefromk(), gsv_getlevfromk(), oti_gettimeinterpweightmpiglobal(), myezuvint_ad(), myezsint_ad(), gsv_transposetilestovarslevsad(), gsv_copy(), gsv_deallocate(), pressureprofilemonotonicitycheck()

subroutine  statetocolumn_mod/s2c_nl(statevector, obsspacedata, column, hco_core, timeinterptype[, varname_opt[, numobsbatches_opt[, dealloc_opt[, moveobsatpole_opt[, besilent_opt]]]]])
Purpose

Non-linear version of the horizontal interpolation, used for a full field (usually the background state when computing the innovation vector).

Arguments
  • statevector [struct_gsv ,inout]

  • obsspacedata [struct_obs ,inout]

  • column [struct_columndata ,inout]

  • hco_core [struct_hco ,in,pointer]

  • timeinterptype [character ,in]

Options
  • varname_opt [character ,in,]

  • numobsbatches_opt [integer ,in,]

  • dealloc_opt [logical ,in,]

  • moveobsatpole_opt [logical ,in,]

  • besilent_opt [logical ,in,]

Called from

bmat1d_setupbens(), ocebg_bgchecksst(), bcs_getradiosondeweight(), inn_setupcolumnsontrllev(), omf_ominusfens(), oer_seterrbackscatanisice(), sstb_getbiascorrection(), midas_ensembleh, midas_letkf

Call to

utl_tmg_start(), utl_tmg_stop(), gsv_isallocated(), utl_abort(), hco_equal(), s2c_deallocinterpinfo(), checkcolumnstatevectormatch(), gsv_varnameslist(), gsv_allocate(), gsv_zero(), gsv_transposetilestovarslevs(), latlonchecksanlgrid(), col_getallcolumns(), obs_numheader(), s2c_setupinterpinfo(), gsv_getvarnamefromk(), myezuvint_nl(), myezsint_nl(), oti_gettimeinterpweightmpiglobal(), col_varexist(), col_getcolumn(), qlim_getminvaluecloud(), qlim_getmaxvaluecloud(), gsv_getheightsfc(), myezsint_r8_nl(), col_setheightsfc(), gsv_deallocate(), pressureprofilemonotonicitycheck()

subroutine  statetocolumn_mod/myezsint_nl(column_out, field_in, interpinfo, kindex, stepindex, procindex)
Purpose

Scalar horizontal interpolation, replaces the ezsint routine from rmnlib.

Arguments
  • column_out (*) [real ,out]

  • field_in (*,*) [real ,in]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_nl()

subroutine  statetocolumn_mod/myezsint_r8_nl(column_out, field_in, interpinfo, kindex, stepindex, procindex)
Purpose

Scalar horizontal interpolation, replaces the ezsint routine from rmnlib.

Arguments
  • column_out (*) [real ,out]

  • field_in (*,*) [real ,in]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_nl()

subroutine  statetocolumn_mod/myezsint_tl(column_out, field_in, interpinfo, kindex, stepindex, procindex)
Purpose

Scalar horizontal interpolation, replaces the ezsint routine from rmnlib.

Arguments
  • column_out (*) [real ,out]

  • field_in (*,*) [real ,in]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_tl()

subroutine  statetocolumn_mod/myezsint_ad(column_in, field_out, interpinfo, kindex, stepindex, procindex)
Purpose

Adjoint of the scalar horizontal interpolation.

Arguments
  • column_in (*) [real ,in]

  • field_out (*,*) [real ,inout]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_ad()

subroutine  statetocolumn_mod/myezuvint_nl(column_out, varname, fielduu_in, fieldvv_in, interpinfo, kindex, stepindex, procindex)
Purpose

Vector horizontal interpolation, replaces the ezuvint routine from rmnlib.

Arguments
  • column_out (*) [real ,out]

  • varname [character ,in]

  • fielduu_in (*,*) [real ,in]

  • fieldvv_in (*,*) [real ,in]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_nl()

Call to

uvr_rotatewind_nl()

subroutine  statetocolumn_mod/myezuvint_tl(column_out, varname, fielduu_in, fieldvv_in, interpinfo, kindex, stepindex, procindex)
Purpose

Vector horizontal interpolation, replaces the ezuvint routine from rmnlib.

Arguments
  • column_out (*) [real ,out]

  • varname [character ,in]

  • fielduu_in (*,*) [real ,in]

  • fieldvv_in (*,*) [real ,in]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_tl()

Call to

uvr_rotatewind_tl()

subroutine  statetocolumn_mod/myezuvint_ad(column_in, varname, fielduu_out, fieldvv_out, interpinfo, kindex, stepindex, procindex)
Purpose

Adjoint of the vector horizontal interpolation.

Arguments
  • column_in (*) [real ,in]

  • varname [character ,in]

  • fielduu_out (*,*) [real ,inout]

  • fieldvv_out (*,*) [real ,inout]

  • interpinfo [struct_interpinfo ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

Called from

s2c_ad()

Call to

uvr_rotatewind_ad()

subroutine  statetocolumn_mod/s2c_bgcheck_bilin(column, statevector, obsspacedata)
Purpose

Special version of s2c_tl used for background check. This should be replaced by direct call to s2c_tl. It is not general enough to be used for new analysis variables.

Arguments
  • column [struct_columndata ,inout]

  • statevector [struct_gsv ,in]

  • obsspacedata [struct_obs ,in]

Called from

ose_compute_hbht_static()

Call to

utl_tmg_start(), col_getnumcol(), obs_headelem_r(), gpos_getpositionxy(), utl_abort(), col_varexist(), col_getcolumn(), gsv_varexist(), gsv_getnumlevfromvarname(), gsv_getoffsetfromvarname(), utl_tmg_stop()

subroutine  statetocolumn_mod/s2c_setuphorizinterp(footprintradius_r4, interpinfo, statevector, headerindex, kindex, stepindex, procindex, numgridpt)
Purpose

To identify the appropriate horizontal interpolation scheme based on footprint radius value. Then to call the corresponding subroutine to determine the grid points and their associated weights.

Arguments
  • footprintradius_r4 [real ,in] :: (metres)

  • interpinfo [struct_interpinfo ,inout]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • numgridpt (interpinfo%hco%numsubgrid) [integer ,out]

Called from

s2c_setupinterpinfo()

Call to

s2c_setupfootprintinterp(), s2c_setupbilinearinterp(), s2c_setuplakeinterp(), s2c_setupnearestneighbor(), utl_abort()

function  statetocolumn_mod/s2c_getfootprintradius(obsspacedata, statevector, headerindex)
Purpose

To determine the footprint radius (metres) of the observation. In the case of bilinear horizontal interpolation, the returned footprint is zero (default).

Arguments
  • obsspacedata [struct_obs ,in]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

Return

fpr [real ]

Called from

findobs(), s2c_setupinterpinfo()

Call to

obs_getfamily(), obs_elem_c(), obs_headelem_i(), utl_abort(), codtyp_get_name(), gettovsfootprintradius()

subroutine  statetocolumn_mod/s2c_rejectzeroweightobs(interpinfo, obsspacedata, mykbeg, mykend)
Purpose

To flag an observation in obsSpaceData as being rejected if it has zero interpolation weight (usually because an ocean obs is touching land) on any mpi task.

Arguments
  • interpinfo [struct_interpinfo ,inout]

  • obsspacedata [struct_obs ,inout]

  • mykbeg [integer ,in]

  • mykend [integer ,in]

Called from

s2c_setupinterpinfo()

Call to

obs_numheader(), obs_headelem_i(), obs_bodyset_i(), obs_headset_i()

subroutine  statetocolumn_mod/s2c_setupbilinearinterp(interpinfo, statevector, headerindex, kindex, stepindex, procindex, numgridpt)
Purpose

To determine the grid points and their associated weights for the bilinear horizontal interpolation. If mask is present we currently can only handle a single 2D mask (like for sea ice or SST analysis). Will abort if multiple ocean levels present.

Arguments
  • interpinfo [struct_interpinfo ,inout]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • numgridpt (interpinfo%hco%numsubgrid) [integer ,out]

Called from

s2c_setuphorizinterp()

Call to

gpos_getpositionxy(), utl_abort()

subroutine  statetocolumn_mod/s2c_setupfootprintinterp(fpr, interpinfo, statevector, headerindex, kindex, stepindex, procindex, numgridpt)
Purpose

To determine the grid points and their associated weights for the footprint horizontal interpolation.

Arguments
  • fpr [real ,in] :: footprint radius (metres)

  • interpinfo [struct_interpinfo ,inout]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • numgridpt (interpinfo%hco%numsubgrid) [integer ,out]

Called from

s2c_setuphorizinterp()

Call to

gpos_getpositionxy(), utl_abort(), kdtree2_3dposition(), kdtree2_r_nearest()

subroutine  statetocolumn_mod/s2c_setuplakeinterp(interpinfo, statevector, headerindex, kindex, stepindex, procindex, numgridpt)
Purpose

To determine the grid points and their associated weights for the lake horizontal interpolation.

Arguments
  • interpinfo [struct_interpinfo ,inout]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • numgridpt (interpinfo%hco%numsubgrid) [integer ,out]

Called from

s2c_setuphorizinterp()

Call to

utl_abort(), gpos_getpositionxy()

subroutine  statetocolumn_mod/s2c_setupnearestneighbor(interpinfo, statevector, headerindex, kindex, stepindex, procindex, numgridpt)
Purpose

Determine the nearest grid points to the observations location

Arguments
  • interpinfo [struct_interpinfo ,inout]

  • statevector [struct_gsv ,in]

  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • numgridpt (interpinfo%hco%numsubgrid) [integer ,out]

Called from

s2c_setuphorizinterp()

Call to

utl_abort(), gpos_getpositionxy()

subroutine  statetocolumn_mod/checkcolumnstatevectormatch(column, statevector)
Purpose

To check column and statevector have identical nk and variables.

Arguments
  • column [struct_columndata ,in]

  • statevector [struct_gsv ,in]

Called from

s2c_tl(), s2c_nl()

Call to

gsv_getnumk(), utl_abort(), gsv_getvarnamefromk(), col_getvarnamefromk()

subroutine  statetocolumn_mod/latlonchecks(obsspacedata, hco, headerindex, rejectoutsideobs, latlev_t, lonlev_t, latlev_m, lonlev_m[, latlev_s_opt[, lonlev_s_opt]])
Purpose

To check if the obs are inside the domain.

Arguments
  • obsspacedata [struct_obs ,inout]

  • hco [struct_hco ,in]

  • headerindex [integer ,in]

  • rejectoutsideobs [logical ,in]

  • latlev_t (*) [real ,inout]

  • lonlev_t (*) [real ,inout]

  • latlev_m (*) [real ,inout]

  • lonlev_m (*) [real ,inout]

Options
  • latlev_s_opt [real ,inout,]

  • lonlev_s_opt [real ,inout,]

Called from

s2c_setupinterpinfo()

Call to

gpos_getpositionxy(), obs_headelem_i(), obs_bodyset_i(), obs_headset_i()

function  statetocolumn_mod/gettovsfootprintradius(obsspacedata, headerindex[, besilent_opt])
Purpose

calculate foot-print radius for TOVS observations

Arguments
  • obsspacedata [struct_obs ,in]

  • headerindex [integer ,in]

Options

besilent_opt [logical ,in,]

Return

footprintradius_r4 [real ]

Called from

s2c_getfootprintradius()

Call to

obs_headelem_i(), codtyp_get_name()

subroutine  statetocolumn_mod/s2c_getweightsandgridpointindexes(headerindex, kindex, stepindex, procindex, interpweight, latindex, lonindex, gridptcount)
Purpose

Returns the weights and grid point indexes for a single observation.

Arguments
  • headerindex [integer ,in]

  • kindex [integer ,in]

  • stepindex [integer ,in]

  • procindex [integer ,in]

  • interpweight (*) [real ,out]

  • latindex (*) [integer ,out]

  • lonindex (*) [integer ,out]

  • gridptcount [integer ,out]

Called from

findobs(), aer_dayssincelastobs(), aer_computeanlerrorstd()

Call to

utl_tmg_start(), utl_abort(), utl_tmg_stop()

subroutine  statetocolumn_mod/s2c_deallocinterpinfo(inputstatevectortype)
Purpose

Deallocate interpInfo_nl/tlad object.

Arguments

inputstatevectortype [character ,in]

Called from

s2c_tl(), s2c_ad(), s2c_nl(), midas_var

Call to

utl_abort(), oti_deallocate()