Model could not recognize variables

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
huangzhy36
Posts: 5
Joined: Wed Feb 27, 2019 8:24 pm
Location: School of Marine Science, Sun Yat-sen University

Model could not recognize variables

#1 Unread post by huangzhy36 »

Hello everyone,

I'm working on a ROMS-SWAN coupling COAWST model, it works well for water dynamic. Then I want to add sediment part in. I prepare the initial file, boundary file and river file for sediment. But when I run the model I get this error:

INQUIRY - unable to find requested variable: mud_time
in file:
/public1/home/sc90163/project_hzhy/coase_21/4m_in/coase_21_bry_nonorth_sed05.nc
Found Error: 02 Line: 442 Source: ROMS/Utility/inquiry.F
Found Error: 02 Line: 123 Source: ROMS/Utility/get_ngfld.F
Found Error: 02 Line: 1259 Source: ROMS/Nonlinear/get_data.F
Found Error: 02 Line: 856 Source: ROMS/Nonlinear/initial.F
Found Error: 02 Line: 200 Source: ROMS/Drivers/nl_ocean.h

Model could not find the variable mud_time, but I do have this variable in my boundary file, I ncdisp this file in matlab:

Code: Select all

 ncdisp('D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc','mud_time')
Source:
           D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc
Format:
           netcdf4
Dimensions:
           mud_time = 976
Variables:
    mud_time
           Size:       976x1
           Dimensions: mud_time
           Datatype:   double
           Attributes:
                       long_name = 'mud time'
                       units     = 'days'
                       field     = 'mud_time, scalar, series'
I have read a post that have similar problem with me in the forum, viewtopic.php?p=24256#p24256, someone said it may because we didn't add the appropriate metadata and logic for the new variables. So what is the "appropriate metadata and logic" for "mud_time" ? I have checked the varinfo.dat, there are no variable "mud_time".
Can anyone give help? Thanks.
Here is my log file
Attachments
log_full_coupled_602_630.dat
(134.46 KiB) Downloaded 327 times

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Model could not recognize variables

#2 Unread post by jcwarner »

are these 2 files the same:

D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc
and
/public1/home/sc90163/project_hzhy/coase_21/4m_in/coase_21_bry_nonorth_sed05.nc

huangzhy36
Posts: 5
Joined: Wed Feb 27, 2019 8:24 pm
Location: School of Marine Science, Sun Yat-sen University

Re: Model could not recognize variables

#3 Unread post by huangzhy36 »

Yes, they are the same. I process the file on my local computer and then upload to the server to run the model.

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Model could not recognize variables

#4 Unread post by jcwarner »

what does this give:
ncdisp('D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc')

huangzhy36
Posts: 5
Joined: Wed Feb 27, 2019 8:24 pm
Location: School of Marine Science, Sun Yat-sen University

Re: Model could not recognize variables

#5 Unread post by huangzhy36 »

This is the information of the boundary file. I want to run the model for 122 days. I give 2D variables boundary every hour and 3D variables boundary every three hours.

Code: Select all

>> ncdisp('D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc')
Source:
           D:\Data\NC\coase_1010\out_4m\coase_21_bry_nonorth_sed05.nc
Format:
           netcdf4
Global Attributes:
           history = 'Created by updatclim on 17-Feb-2023 15:40:04'
           type    = 'climate forcing file from http://hycom.coaps.fsu.edu:8080/thredds/dodsC/glb_analysis'
Dimensions:
           xpsi      = 481
           xrho      = 482
           xu        = 481
           xv        = 482
           epsi      = 169
           erho      = 170
           eu        = 170
           ev        = 169
           s_rho     = 15
           zeta_time = 2928
           v2d_time  = 2928
           v3d_time  = 976
           salt_time = 976
           temp_time = 976
           mud_time  = 976
Variables:
    zeta_time   
           Size:       2928x1
           Dimensions: zeta_time
           Datatype:   double
           Attributes:
                       long_name = 'zeta_time'
                       units     = 'days'
                       field     = 'zeta_time, scalar, series'
    v2d_time    
           Size:       2928x1
           Dimensions: v2d_time
           Datatype:   double
           Attributes:
                       long_name = 'v2d_time'
                       units     = 'days'
                       field     = 'v2d_time, scalar, series'
    v3d_time    
           Size:       976x1
           Dimensions: v3d_time
           Datatype:   double
           Attributes:
                       long_name = 'v3d_time'
                       units     = 'days'
                       field     = 'v3d_time, scalar, series'
    salt_time   
           Size:       976x1
           Dimensions: salt_time
           Datatype:   double
           Attributes:
                       long_name = 'salt_time'
                       units     = 'days'
                       field     = 'salt_time, scalar, series'
    temp_time   
           Size:       976x1
           Dimensions: temp_time
           Datatype:   double
           Attributes:
                       long_name = 'temp_time'
                       units     = 'days'
                       field     = 'temp_time, scalar, series'
    mud_time    
           Size:       976x1
           Dimensions: mud_time
           Datatype:   double
           Attributes:
                       long_name = 'mud_time'
                       units     = 'days'
                       field     = 'mud_time, scalar, series'
    zeta_south  
           Size:       482x2928
           Dimensions: xrho,zeta_time
           Datatype:   double
           Attributes:
                       long_name = 'free-surface southern boundary condition'
                       units     = 'meter'
                       field     = 'zeta_south, scalar, series'
    zeta_east   
           Size:       170x2928
           Dimensions: erho,zeta_time
           Datatype:   double
           Attributes:
                       long_name = 'free-surface eastern boundary condition'
                       units     = 'meter'
                       field     = 'zeta_east, scalar, series'
    ubar_south  
           Size:       481x2928
           Dimensions: xu,v2d_time
           Datatype:   single
           Attributes:
                       long_name = '2D u-momentum southern boundary condition'
                       units     = 'meter second-1'
                       field     = 'ubar_south, scalar, series'
    ubar_east   
           Size:       170x2928
           Dimensions: eu,v2d_time
           Datatype:   single
           Attributes:
                       long_name = '2D u-momentum eastern boundary condition'
                       units     = 'meter second-1'
                       field     = 'ubar_east, scalar, series'
    vbar_south  
           Size:       482x2928
           Dimensions: xv,v2d_time
           Datatype:   single
           Attributes:
                       long_name = '2D v-momentum southern boundary condition'
                       units     = 'meter second-1'
                       field     = 'vbar_south, scalar, series'
    vbar_east   
           Size:       169x2928
           Dimensions: ev,v2d_time
           Datatype:   single
           Attributes:
                       long_name = '2D v-momentum eastern boundary condition'
                       units     = 'meter second-1'
                       field     = 'vbar_east, scalar, series'
    temp_south  
           Size:       482x15x976
           Dimensions: xrho,s_rho,temp_time
           Datatype:   single
           Attributes:
                       long_name = '3D temperature southern boundary condition'
                       units     = 'C'
                       field     = 'temp_south, scalar, series'
    temp_east   
           Size:       170x15x976
           Dimensions: erho,s_rho,temp_time
           Datatype:   single
           Attributes:
                       long_name = '3D temperature eastern boundary condition'
                       units     = 'C'
                       field     = 'temp_east, scalar, series'
    salt_south  
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = '3D salinity southern boundary condition'
                       units     = 'psu'
                       field     = 'salt_south, scalar, series'
    salt_east   
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = '3D salinity eastern boundary condition'
                       units     = 'psu'
                       field     = 'salt_east, scalar, series'
    mud_south_01
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'southern boundary mud,size calss 01'
                       units     = 'kilogram meter-3'
                       field     = 'mud_south, scalar, series'
    mud_east_01 
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'eastern boundary mud,size calss 01'
                       units     = 'kilogram meter-3'
                       field     = 'mud_east, scalar, series'
    mud_south_02
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'southern boundary mud,size calss 02'
                       units     = 'kilogram meter-3'
                       field     = 'mud_south, scalar, series'
    mud_east_02 
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'eastern boundary mud,size calss 02'
                       units     = 'kilogram meter-3'
                       field     = 'mud_east, scalar, series'
    mud_south_03
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'southern boundary mud,size calss 03'
                       units     = 'kilogram meter-3'
                       field     = 'mud_south, scalar, series'
    mud_east_03 
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'eastern boundary mud,size calss 03'
                       units     = 'kilogram meter-3'
                       field     = 'mud_east, scalar, series'
    mud_south_04
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'southern boundary mud,size calss 04'
                       units     = 'kilogram meter-3'
                       field     = 'mud_south, scalar, series'
    mud_east_04 
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'eastern boundary mud,size calss 04'
                       units     = 'kilogram meter-3'
                       field     = 'mud_east, scalar, series'
    mud_south_05
           Size:       482x15x976
           Dimensions: xrho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'southern boundary mud,size calss 05'
                       units     = 'kilogram meter-3'
                       field     = 'mud_south, scalar, series'
    mud_east_05 
           Size:       170x15x976
           Dimensions: erho,s_rho,salt_time
           Datatype:   single
           Attributes:
                       long_name = 'eastern boundary mud,size calss 05'
                       units     = 'kilogram meter-3'
                       field     = 'mud_east, scalar, series'
The "mud_" variable have a time dimension "salt_time", that's a mistake I made in creating boundary file. But infact salt_time and mud_time are the same. Is this make things wrong?

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Model could not recognize variables

#6 Unread post by jcwarner »

i see the mud_time is the same as salt_time. but i dont think that is the problem. you should be able to list any name, as long as the dimension information is correct.
you also need to look in the varinfo.dat. the mud vars should be listed as using mud_time.
maybe try to change varinfo from mud_time to salt_time and see if that helps.
i am not sure why it is having trouble. let me know if that works. i can modify a test case here and see if i can reproduce your problem.

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Model could not recognize variables

#7 Unread post by wilkin »

I think you are confusing dimensions and coordinate variables.

It does not matter whether a variable is dimensioned salt_time or mud_time. That conveys no information to ROMS about the time coordinate. Which time coordinate to use to interpret the index into the time dimension can be specified either in varinfo.dat or - and this is my preference - by including a time attribute for each variable that clearly names the variable (not dimension) in the file to use.

For example, in the CDL template for sediment initial conditions at myroms.org ...

Code: Select all

ini_sed.cdl:	float mud_01(ocean_time, s_rho, eta_rho, xi_rho) ;
ini_sed.cdl:		mud_01:long_name = "suspended cohesive sediment, size class 01" ;
ini_sed.cdl:		mud_01:size_class = " 1.0000E-02 millimeter" ;
ini_sed.cdl:		mud_01:units = "milligram liter-1" ;
ini_sed.cdl:		mud_01:time = "ocean_time" ;
ini_sed.cdl:		mud_01:coordinates = "lon_rho lat_rho s_rho ocean_time" ;
the attribute time indicates "ocean_time", so ROMS will read the variable named ocean_time in this file. This setting overrides anything in varinfo.dat.

Including the coordinates attribute is best practice but won't affect how ROMS runs.

Your posts indicate that you have kept the default time coordinate name mud_time in varinfo.dat, but we haven't actually see that to be sure.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

huangzhy36
Posts: 5
Joined: Wed Feb 27, 2019 8:24 pm
Location: School of Marine Science, Sun Yat-sen University

Re: Model could not recognize variables

#8 Unread post by huangzhy36 »

Thanks for your help, Warner. I fix the problem. The cause of the problem is the dimension name of variables in boundary file mismatch the setting in varinfo.dat. I try your suggestion, change the time dimension of mud boundary from "mud_time" to "salt_time", consistent with what I gave in boundary file, it works. Then I recreate a boundary file that mud boundary have time dimension "mud_time", and run with the varinfo.dat that have the same setting as the boundary file, the model also runs well.

Also, thanks Wilkin for your explanation, I will try next time.

Joeailvyou
Posts: 26
Joined: Wed Jul 19, 2017 4:03 pm
Location: Zhejiang University

Re: Model could not recognize variables

#9 Unread post by Joeailvyou »

wilkin wrote: Sun Feb 19, 2023 2:34 pm I think you are confusing dimensions and coordinate variables.

It does not matter whether a variable is dimensioned salt_time or mud_time. That conveys no information to ROMS about the time coordinate. Which time coordinate to use to interpret the index into the time dimension can be specified either in varinfo.dat or - and this is my preference - by including a time attribute for each variable that clearly names the variable (not dimension) in the file to use.

For example, in the CDL template for sediment initial conditions at myroms.org ...

Code: Select all

ini_sed.cdl:	float mud_01(ocean_time, s_rho, eta_rho, xi_rho) ;
ini_sed.cdl:		mud_01:long_name = "suspended cohesive sediment, size class 01" ;
ini_sed.cdl:		mud_01:size_class = " 1.0000E-02 millimeter" ;
ini_sed.cdl:		mud_01:units = "milligram liter-1" ;
ini_sed.cdl:		mud_01:time = "ocean_time" ;
ini_sed.cdl:		mud_01:coordinates = "lon_rho lat_rho s_rho ocean_time" ;
the attribute time indicates "ocean_time", so ROMS will read the variable named ocean_time in this file. This setting overrides anything in varinfo.dat.

Including the coordinates attribute is best practice but won't affect how ROMS runs.

Your posts indicate that you have kept the default time coordinate name mud_time in varinfo.dat, but we haven't actually see that to be sure.
Dear Wilkin,
I am wandering your ocean_time:
1. When the time of variables is ocean_time, a variable instead of a dimension named ocean_time has to exist in the climatology, forcing, and boundary file, right ?
2. The attribute units of ocean_time has to be specified, right ? In many cases, it is usually day. Can we use second or month ?
3. The reference time for ocean_time can be specified by one of the attribute units [like "days since 1980-01-01 00:00:00"] or TIME_REF in the .in file ? Only one of them would work ?
4. As we known, the name ocean_time is also a variable defined by the varinfo.dat in the model state. When we used ocean_time in the climatology, forcing, and boundary file, is there conflicts with the one [ocean_time] in the varinfo.dat in model state ? What's more, the units of the ocean_time is second in varinfo.dat, while we usually specify units as day in the climatology, forcing, and boundary file.
5. If I have more questions about how roms process the time of the input variable, which .F file should I read ?

Post Reply