Skip to content

How to define correctly mask in observation dataset? #85

@alvaroggc

Description

@alvaroggc

Hi!

I've been trying to run GARD with gridded high resolution observations that only have data over the continent. Inside this observation file there are only two variables: "t2m" (variable to train downscaling routine) and "ocn_mask" is the ocean mask variable. The file looks like this:

netcdf obs_cr2met_1993_2016_tmean {
dimensions:
    lon = 220 ;
    lat = 800 ;
    time = 287 ;
variables:
    double lon(lon) ;
        lon:_FillValue = NaN ;
        lon:long_name = "longitude" ;
        lon:units = "degrees_east" ;
    double lat(lat) ;
        lat:_FillValue = NaN ;
        lat:long_name = "latitude" ;
        lat:units = "degrees_north" ;
    float t2m(time, lat, lon) ;
        tmean:_FillValue = NaNf ;
        tmean:long_name = "2-meter daily mean temperature" ;
        tmean:units = "Celsius" ;
    int64 time(time) ;
        time:long_name = "time" ;
        time:units = "days since 1990-01-01 00:00:00" ;
        time:calendar = "gregorian" ;
    float ocn_mask(lat, lon) ;
        ocn_mask:_FillValue = NaNf ;
        ocn_mask:long_name = "mask ocean Chile" ;
        ocn_mask:units = "1" ;

Inside de downscale_options.txt file, the obs_parameters section looks as follows:

&obs_parameters
    name = "CR2MET data"

    nvars     = 1           ! theoretically this might work with more variables, but it hasn't been fully implemented yet
    nfiles    = 1
    data_type = "obs"
    lat_name  = "lat"
    lon_name  = "lon"
    time_name = "time"

    ! this transformation will be applied to the obs before e.g. performing regressions, and the inverse transformation will be applied to the model output
    input_transformations = 3
    var_names = "t2m"
    file_list = "filelists/obs_cr2met_list.txt"

    calendar  = "gregorian"
    calendar_start_year = 1900

    ! specify a variable to use to find which grid cells should be masked
    mask_variable = 1
    ! specify a value to use to in that variable to define masked gridcells
    mask_value = 1e20
/

So "mask_variable" should be a number and not a name? I keep digging and in the config/configuration.90 file, line 571 appears the following:

571         integer :: mask_variable

So my question is, how exactly do I define this variable?

mask_variable = 1
mask_variable = "ocn_mask"

The first choice (leaving the default value 1) sends me the following error:

  Writing input data
  NetCDF: String match to name in use
  obs_preload_tmean.nc:data
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
STOP Stopped

The second choice (using "ocn_mask", which I thought was the correct one) sends me the following message:

At line 601 of file config/configuration.f90 (unit = 10, file = 'downscale_options.txt')
Fortran runtime error: Cannot match namelist object name "ocn_mask"

Error termination. Backtrace:
#0  0x1519da2389cd in finalize_transfer
at ../../../libgfortran/io/transfer.c:4362
#1  0x55d41ed792e8 in ???
#2  0x55d41edff43b in ???
#3  0x55d41ed6471e in ???
#4  0x1519d9c295cf in ???
#5  0x1519d9c2967f in ???
#6  0x55d41ed6474e in ???
#7  0xffffffffffffffff in ???

Can anyone help me on how to use the "mask_variable" correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions