problem with atmospheric forcing.

Discussion of how to use ROMS on different regional and basin scale applications.

Moderators: arango, robertson

Post Reply
Message
Author
cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

problem with atmospheric forcing.

#1 Post by cyhsu » Thu Jun 16, 2016 8:13 pm

Hi, All,

I have a problem with the atmospheric forcing using non-bulk formula.
The situation I had met is, I have a ROMS simulation result which is used to as a control run. I want to keep the atmospheric forcing is the same with the control run, but only change the wind field to see the dynamics difference in the upper ocean.

So that, I extracted the shflux, sustr, svstr, and EminusP from the control run output, and renamed the EminusP to the swflux. (The input variables are used according to viewtopic.php?f=30&t=3003&hilit=boundary+conditions)

netcdf nobulk_atmos_forcing {
dimensions:
ocean_time = UNLIMITED ; // (6 currently)
eta_rho = 489 ;
xi_rho = 655 ;
eta_u = 489 ;
xi_u = 654 ;
eta_v = 488 ;
xi_v = 655 ;
variables:
float swflux(ocean_time, eta_rho, xi_rho) ;
swflux:long_name = "bulk_flux surface net freswater flux, (E-P)" ;
swflux:units = "meter second-1" ;
swflux:negative_value = "upward flux, freshening (net precipitation)" ;
swflux:positive_value = "downward flux, salting (net evaporation)" ;
swflux:time = "ocean_time" ;
swflux:coordinates = "lon_rho lat_rho ocean_time" ;
swflux:field = "EminusP, scalar, series" ;
swflux:_FillValue = 1.e+37f ;
double lat_rho(eta_rho, xi_rho) ;
lat_rho:long_name = "latitude of RHO-points" ;
lat_rho:units = "degree_north" ;
lat_rho:standard_name = "latitude" ;
lat_rho:field = "lat_rho, scalar" ;
double lat_u(eta_u, xi_u) ;
lat_u:long_name = "latitude of U-points" ;
lat_u:units = "degree_north" ;
lat_u:standard_name = "latitude" ;
lat_u:field = "lat_u, scalar" ;
double lat_v(eta_v, xi_v) ;
lat_v:long_name = "latitude of V-points" ;
lat_v:units = "degree_north" ;
lat_v:standard_name = "latitude" ;
lat_v:field = "lat_v, scalar" ;
double lon_rho(eta_rho, xi_rho) ;
lon_rho:long_name = "longitude of RHO-points" ;
lon_rho:units = "degree_east" ;
lon_rho:standard_name = "longitude" ;
lon_rho:field = "lon_rho, scalar" ;
double lon_u(eta_u, xi_u) ;
lon_u:long_name = "longitude of U-points" ;
lon_u:units = "degree_east" ;
lon_u:standard_name = "longitude" ;
lon_u:field = "lon_u, scalar" ;
double lon_v(eta_v, xi_v) ;
lon_v:long_name = "longitude of V-points" ;
lon_v:units = "degree_east" ;
lon_v:standard_name = "longitude" ;
lon_v:field = "lon_v, scalar" ;
double ocean_time(ocean_time) ;
ocean_time:long_name = "time since initialization" ;
ocean_time:units = "seconds since 2010-01-01 00:00:00" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
float shflux(ocean_time, eta_rho, xi_rho) ;
shflux:long_name = "surface net heat flux" ;
shflux:units = "watt meter-2" ;
shflux:negative_value = "upward flux, cooling" ;
shflux:positive_value = "downward flux, heating" ;
shflux:time = "ocean_time" ;
shflux:coordinates = "lon_rho lat_rho ocean_time" ;
shflux:field = "surface heat flux, scalar, series" ;
shflux:_FillValue = 1.e+37f ;
float sustr(ocean_time, eta_u, xi_u) ;
sustr:long_name = "surface u-momentum stress" ;
sustr:units = "newton meter-2" ;
sustr:time = "ocean_time" ;
sustr:coordinates = "lon_u lat_u ocean_time" ;
sustr:field = "surface u-momentum stress, scalar, series" ;
sustr:_FillValue = 1.e+37f ;
float svstr(ocean_time, eta_v, xi_v) ;
svstr:long_name = "surface v-momentum stress" ;
svstr:units = "newton meter-2" ;
svstr:time = "ocean_time" ;
svstr:coordinates = "lon_v lat_v ocean_time" ;
svstr:field = "surface v-momentum stress, scalar, series" ;
svstr:_FillValue = 1.e+37f ;



After that, I changed surface forcing parameterization from my original header file with Bulk FLUXES to this one.

/* surface forcing */
# undef BULK_FLUXES /*# define BULK_FLUXES*/ /* original set up */
# ifdef BULK_FLUXES
# define LONGWAVE_OUT
# define EMINUSP
# define SOLAR_SOURCE
# undef DIURNAL_SRFLUX
# else
# define ANA_SSFLUX
# define ANA_SMFLUX
# define ANA_STFLUX
# endif


After I recompiled and run it, the system shows this error to me.


forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
oceanG 0000000000B8CB01 Unknown Unknown Unknown
oceanG 0000000000B8B257 Unknown Unknown Unknown
libnetcdff.so.6 00002B95836B6782 Unknown Unknown Unknown
libnetcdff.so.6 00002B95836B65D6 Unknown Unknown Unknown
libnetcdff.so.6 00002B958369D15C Unknown Unknown Unknown
libnetcdff.so.6 00002B95836A11C8 Unknown Unknown Unknown
libpthread.so.0 00002B95873747E0 Unknown Unknown Unknown
libnetcdff.so.6 00002B95836B253F Unknown Unknown Unknown
oceanG 0000000000439EAC load_s2d_ 1564 inp_par.f90
oceanG 0000000000481B8C read_phypar_ 1215 read_phypar.f90
oceanG 000000000040F213 inp_par_ 88 inp_par.f90
oceanG 000000000040666D ocean_control_mod 84 ocean_control.f90
oceanG 000000000040635F MAIN__ 95 master.f90
oceanG 000000000040616E Unknown Unknown Unknown
libc.so.6 00002B9588646D5D Unknown Unknown Unknown
oceanG 0000000000406009 Unknown Unknown Unknown



Could someone tell me what is happened on here?

Thank You,
Franke

User avatar
kate
Posts: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: problem with atmospheric forcing.

#2 Post by kate » Thu Jun 16, 2016 9:08 pm

Code: Select all

load_s2d_ 1564 inp_par.f90
In trunk code, this is used to parse the forcing files. A seg fault here could be due to telling it the wrong number of forcing files in NFFILES. In the COAWST/ice branch code, load_s2d is also used for BRY/CLM files. Seg faults from load_s2d are becoming a FAQ... which branch do you have and what's at line 1215 of read_phypar.f90 in your build directory?

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#3 Post by cyhsu » Thu Jun 16, 2016 9:20 pm

Yes, I found out it is due to the NFFILES issue.
Once I modified it, the ROMS output show this error.



INQUIRE - unable to find requested variable: SSS
in files:
./run_without_nif/gom03_his_0228_nobulk_new.nc
./run_without_nif/gom03_his_0229_nobulk_new.nc

INQUIRE - unable to find requested variable: SSS
in files:
./run_without_nif/gom03_his_0228_nobulk_new.nc
./run_without_nif/gom03_his_0229_nobulk_new.nc

INQUIRE - unable to find requested variable: SSS
in files:
./run_without_nif/gom03_his_0228_nobulk_new.nc
./run_without_nif/gom03_his_0229_nobulk_new.nc
INQUIRE - unable to find requested variable: SSS
in files:
./run_without_nif/gom03_his_0228_nobulk_new.nc
./run_without_nif/gom03_his_0229_nobulk_new.nc

Elapsed CPU time (seconds):

Node # 0 CPU: 9.281
Node # 13 CPU: 10.022
Node # 11 CPU: 10.016
Node # 5 CPU: 10.029
Node # 4 CPU: 10.044
Node # 12 CPU: 10.006
Node # 8 CPU: 10.057
Node # 6 CPU: 10.029
Node # 2 CPU: 10.021
Node # 3 CPU: 10.047
Node # 1 CPU: 9.976
Node # 14 CPU: 10.042
Node # 16 CPU: 9.973
Node # 7 CPU: 10.035
Node # 15 CPU: 9.965
Node # 18 CPU: 9.854
Node # 10 CPU: 9.890
Node # 19 CPU: 9.924
Node # 9 CPU: 10.012
Node # 17 CPU: 9.075
Total: 198.305

Nonlinear model elapsed time profile:

Allocation and array initialization .............. 17.579 ( 8.8648 %)
2D/3D coupling, vertical metrics ................. 3.325 ( 1.6770 %)
Omega vertical velocity .......................... 1.485 ( 0.7487 %)
Equation of state for seawater ................... 10.000 ( 5.0430 %)
Total: 32.390 16.3335

Nonlinear model message Passage profile:

Message Passage: 2D halo exchanges ............... 0.693 ( 0.3494 %)
Message Passage: 3D halo exchanges ............... 2.094 ( 1.0558 %)
Message Passage: data broadcast .................. 90.325 (45.5487 %)
Message Passage: data reduction .................. 0.066 ( 0.0333 %)
Message Passage: data scattering.................. 54.577 (27.5216 %)
Total: 147.755 74.5088

All percentages are with respect to total time = 198.305

ROMS/TOMS - Output NetCDF summary for Grid 01:

Analytical header files used:

ROMS/Functionals/ana_hmixcoef.h
ROMS/Functionals/ana_nudgcoef.h

ROMS/TOMS - Input error ............. exit_flag: 2


ERROR: Abnormal termination: NetCDF INPUT.
REASON: No error



Do you mind to tell me where can I find if I use atmospheric surface flux, what kind of variables I need to provide?

User avatar
kate
Posts: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: problem with atmospheric forcing.

#4 Post by kate » Thu Jun 16, 2016 9:37 pm

You need to provide SSS if you have either SCORRECTION or SRELAXATION defined.

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#5 Post by cyhsu » Thu Jun 16, 2016 10:42 pm

Thank You, It is running right now.
Here is my nco code for future user.

Code: Select all

#!/bin/bash
add_f='_nobulk_new.nc'
for fid in $*
do
	nfid=`echo $fid|sed 's/\.nc$//'`$add_f
	ncks -h -O -v swrad,EminusP,shflux,ssflux,sustr,svstr $fid $nfid
	ncrename -h -O -v EminusP,swflux $nfid $nfid
done
ncrcat -h -O *nobulk_new*nc gom03_his_nobulk_new.nc
rm -rf *_his_0???_nobulk_new.nc

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

Re: problem with atmospheric forcing.

#6 Post by wilkin » Fri Jun 17, 2016 1:38 pm

After that, I changed surface forcing parameterization from my original header file with Bulk FLUXES to this one.

/* surface forcing */
# undef BULK_FLUXES /*# define BULK_FLUXES*/ /* original set up */
# ifdef BULK_FLUXES
# define LONGWAVE_OUT
# define EMINUSP
# define SOLAR_SOURCE
# undef DIURNAL_SRFLUX
# else
# define ANA_SSFLUX
# define ANA_SMFLUX
# define ANA_STFLUX

# endif
To me it looks like your ELSE block is going to cause ROMS to use analytical forincg, not your new netCDF file. Check stdout to see it actually read the new forcing data.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#7 Post by cyhsu » Fri Jun 17, 2016 6:09 pm

Yes, after few days simulation run, I figured out that the sustr/svstr from my new run is not the same with the one I provided. Although the ROMS information output showing that I had input the files.

Code: Select all

Output/Input Files:

             Output Restart File:  output/gom03_rst.nc
        Prefix for History Files:  output/gom03_his
       Prefix for Averages Files:  output/gom03_avg
                 Input Grid File:  ./input/gom03_grd_N060_hc200.nc
    Input Nonlinear Initial File:  ./gom03_rst.nc
           Input Forcing File 01:  ./run_without_nif/gom03_his_nobulk_new.nc
           Input Forcing File 02:  ./input/gom03_sss_CARS09_2010.nc
             Input Boundary File:  ./input/gom03_N060_hc200_rst_bry_HyCOM_2010_1dmean.nc
So that in case, shall I need to undefinite those of parameterizations, too?

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

Re: problem with atmospheric forcing.

#8 Post by wilkin » Fri Jun 17, 2016 7:22 pm

Although the ROMS information output showing that I had input the files.
That list only echoes the forcing files that ROMS identified from your ocean.in. What you need to look for is the report to stdout as to the data read from those files by GET_2DLFD, e.g. something like:

Code: Select all

    GET_2DFLD   - surface u-wind component,                  t =   181 00:00:00
                   (Rec=1449, Index=1, File: Uwind_narr_MAB_and_GoM.nc)
                   (Tmin=          0.0000 Tmax=        698.8750)
                   (Min =  2.38705628E+00 Max =  4.07612201E+00)
    GET_2DFLD   - surface v-wind component,                  t =   181 00:00:00
                   (Rec=1449, Index=1, File: Vwind_narr_MAB_and_GoM.nc)
                   (Tmin=          0.0000 Tmax=        698.8750)
                   (Min =  2.18106666E-01 Max =  2.48365424E+00)
This confirms the names of the variables read, which file they were read from, the time values and records numbers, and the min and max. This is a terrific sanity check on whether you got what you intended.

Reading from netcdf forcing files is the default, so, yes, you want:
# else
# undef ANA_SSFLUX
# undef ANA_SMFLUX
# undef ANA_STFLUX
# endif

Or just don't mention them at all, because they are implicitly undefined.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#9 Post by cyhsu » Fri Jun 17, 2016 9:16 pm

Understood!!!!! :P

Thanks for notifying me this. Now, after I check the atmospheric input "sustr", "svstr", "swrad", and "shflux" are the same, but I do not know why now ROMS cannot output the variables related to EminusP, such as EminusP, precipitation, and evaporation.

I checked the ROMS output file, EminusP has read in already.

Code: Select all

    GET_2DFLD   - surface u-momentum stress,                 t =   136 01:00:00
                   (Rec=0007, Index=2, File: gom03_his_nobulk_new.nc)
                   (Tmin=        135.7917 Tmax=        153.7500)
                   (Min = -9.85529219E-05 Max =  8.66760386E-06)
    GET_2DFLD   - surface v-momentum stress,                 t =   136 01:00:00
                   (Rec=0007, Index=2, File: gom03_his_nobulk_new.nc)
                   (Tmin=        135.7917 Tmax=        153.7500)
                   (Min = -3.41824170E-05 Max =  7.67184394E-05)
    GET_2DFLD   - solar shortwave radiation flux,            t =   136 01:00:00
                   (Rec=0007, Index=2, File: gom03_his_nobulk_new.nc)
                   (Tmin=        135.7917 Tmax=        153.7500)
                   (Min =  1.77043083E-05 Max =  5.32416035E-05)
    GET_2DFLD   - surface net heat flux,                     t =   136 01:00:00
                   (Rec=0007, Index=2, File: gom03_his_nobulk_new.nc)
                   (Tmin=        135.7917 Tmax=        153.7500)
                   (Min = -3.55436272E-05 Max =  4.47456002E-05)
    GET_2DFLD   - surface net freswater flux, (E-P),         t =   136 01:00:00
                   (Rec=0007, Index=2, File: gom03_his_nobulk_new.nc)
                   (Tmin=        135.7917 Tmax=        153.7500)
                   (Min = -1.50365067E-14 Max =  6.81671269E-15)
    GET_2DFLD   - sea surface salinity climatology,          t =   136 18:00:00
                   (Rec=0005, Index=2, File: gom03_sss_CARS09_2010.nc)
                   (Tmin=         15.0000 Tmax=        349.8125)
                   (Min =  1.24053098E-01 Max =  3.73178520E+01)


Meanwhile, the 3D variable "temp" is not the same comparing with my original ROMS.
Is this correct, too?

Thank You for answering my questions.

User avatar
kate
Posts: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: problem with atmospheric forcing.

#10 Post by kate » Fri Jun 17, 2016 9:24 pm

You mean there's no EminusP for Aout?

Code: Select all

Hout(idEmPf) == F       ! EminusP            E-P flux 
Hout(idevap) == F       ! evaporation        evaporation rate 
Hout(idrain) == F       ! rain               precipitation rate 
and

Code: Select all

Aout(idevap) == F       ! evaporation        evaporation rate
Aout(idrain) == F       ! rain               precipitation rate
It shouldn't be that hard to add it to the averages output. :mrgreen:

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#11 Post by cyhsu » Fri Jun 17, 2016 9:49 pm

Actually, I turn on the options before the simulation began.
But it does not output E-P flux, evaporation rate, and precipitation rate.

Code: Select all

Hout(idTsur) == T T     ! shflux, ssflux     surface net heat and salt flux
Hout(idLhea) == T       ! latent             latent heat flux
Hout(idShea) == T       ! sensible           sensible heat flux
Hout(idLrad) == T       ! lwrad              longwave radiation flux
Hout(idSrad) == T       ! swrad              shortwave radiation flux
Hout(idEmPf) == T       ! EminusP            E-P flux
Hout(idevap) == T       ! evaporation        evaporation rate
Hout(idrain) == T       ! rain               precipitation rate

User avatar
kate
Posts: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: problem with atmospheric forcing.

#12 Post by kate » Fri Jun 17, 2016 11:06 pm

The three relevant files are def_his.F, wrt_his.F and read_phypar.F. In all three, the relevant code is inside "# ifdef EMINUSP". Try defining that.

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

Re: problem with atmospheric forcing.

#13 Post by wilkin » Sat Jun 18, 2016 12:51 pm

You can't have evaporation and precipitation separately in the output if you're not using BULK FLUXES. Evaporation is only computed if latent heat exchange is computed.

You are imposing surface net freshwater flux and net heat flux as inputs. There is no way to separation the rain from the net.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

cyhsu
Posts: 8
Joined: Tue Nov 17, 2015 8:49 pm
Location: TAMU

Re: problem with atmospheric forcing.

#14 Post by cyhsu » Tue Jun 21, 2016 5:46 pm

Thank You,

The reason why I want to have EminusP fro my new simulation is because I want to make sure the input is correct.

Thank You.

Post Reply