Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
hyc006
Posts: 24
Joined: Thu Nov 30, 2023 2:12 am
Location: UCSD

Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

#1 Unread post by hyc006 »

I'm trying to run an idealized ROMS model and want to eliminate surface heat and salt fluxes. I've successfully turned off the shortwave and longwave radiation by setting `ANA_SRFLUX` and creating a longwave radiation forcing file.

Now, I'm trying to do the same for "sensible heat flux", "latent heat flux", "net surface heat flux", and "net surface salt flux". I referred to the webpage: https://www.myroms.org/index.php?page=forcing and created the forcing files for `sward`, `lward`, `shflux`, `swflux`, and `sensible`. However, my log file only shows the longwave radiation variables being read.

Log file excerpt:

Code: Select all

NL ROMS/TOMS: started time-stepping: (Grid: 01 TimeSteps: 000000000001 - 000000259200)

    GET_2DFLD   - net longwave radiation flux,                     0001-02-03 00:00:00.00
                   (Grid=01, Rec=5, Index=2, File: roms_forcing_lrf_0621.nc)
                   (Tmin=       -367.0000 Tmax=        633.0000)      t =         33.0000
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)      regrid = F
    GET_3DFLD   - potential temperature climatology,               4732-02-09 00:00:00.00
                   (Grid=01, Rec=2, Index=2, File: clm_smooth_0621_stra_tight_20.nc)
                   (Tmin=          0.0000 Tmax=   12096000.0000)      t =    1728000.0000
                   (Min =  2.30000007E+01 Max =  2.69986572E+01)
It seems the model isn't reading the forcing files for sensible heat flux and other variables. Here are the relevant parts of my `.in` and `.h` files:

`.in` file:

Code: Select all

NFFILES == 5                          ! number of unique forcing files

FRCNAME == /home/hyc006/ideal_model/with_clm/roms_forcing_srf_0621.nc \
            /home/hyc006/ideal_model/with_clm/roms_forcing_lrf_0621.nc \
            /home/hyc006/ideal_model/with_clm/roms_forcing_shflux_0621.nc \
            /home/hyc006/ideal_model/with_clm/roms_forcing_swflux_0621.nc \
            /home/hyc006/ideal_model/with_clm/roms_forcing_sensible_0621.nc
`.h` file:

Code: Select all

#define BULK_FLUXES

#ifdef BULK_FLUXES
# define ANA_WINDS
# define ANA_CLOUD
# define ANA_SRFLUX  /* solar radiation */
# define ANA_STFLUX  /* NET SURFACE TRACER FLUX */
# define ANA_SSFLUX 
# define ANA_TAIR
# define ANA_HUMIDITY
# define ANA_PAIR
# define ATM_PRESS
# define PRESS_COMPENSATE
# define ANA_RAIN
# undef LONGWAVE /* use Berliand relation */
# define EMINUSP  /* compute evaporation minus precipitation */
#endif
Can anyone help me identify why the model is not reading in the other forcing files?
Thanks so much for your help!

Hsin-Yi

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

Re: Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

#2 Unread post by wilkin »

Sensible and latent heat are not input variables. They are only outputs that are calculated and optionally saved.

In the varinfo.yaml file look to the right of the variable name and you see an entry that is either #Input, #Output or #Input/Output.

sensible and latent are outputs only.

Code: Select all

  - variable:       lwrad                                            # Input/Output
    standard_name:  surface_net_downward_longwave_flux
    long_name:      net longwave radiation flux
    units:          watt meter-2                                     # Input:  [Watt/m2]
    field:          longwave radiation                               # [Celsius m/s]
    time:           lrf_time                                         # Output: [Watt/m2]
    index_code:     idLrad
    type:           r2dvar
    add_offset:     0.0d0
    scale:          1.0d0

  - variable:       latent                                           # Output
    standard_name:  surface_upward_latent_heat_flux
    long_name:      net latent heat flux
    units:          watt meter-2                                     # [Celsius m/s]
    field:          latent heat flux                                 # Output: [Watt/m2]
    time:           lhf_time
    index_code:     idLhea
    type:           r2dvar
    add_offset:     0.0d0
    scale:          1.0d0

  - variable:       sensible                                         # Output
    standard_name:  surface_upward_sensible_heat_flux
    long_name:      net sensible heat flux
    units:          watt meter-2                                     # [Celsius m/s]
    field:          sensible heat flux                               # Output: [Watt/m2]
    time:           shf_time
    index_code:     idShea
    type:           r2dvar
    add_offset:     0.0d0
    scale:          1.0d0
The net heat flux is variable shflux. That is what you need to set.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

hyc006
Posts: 24
Joined: Thu Nov 30, 2023 2:12 am
Location: UCSD

Re: Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

#3 Unread post by hyc006 »

Thanks for your reply! I still got a question for the net heat flux. I've make a forcing file for the shflux for the net heat flux just like you said.
wilkin wrote: Fri Jun 28, 2024 2:12 pm The net heat flux is variable shflux. That is what you need to set.
However, I find out that in the log file the net heat flux forcing file is not be read by the model, it only read in the short and longwave radiation

Code: Select all

GET_2DFLD   - solar shortwave radiation flux,                  0000-10-26 00:00:00.00
                   (Grid=01, Rec=4, Index=1, File: roms_forcing_srf_0627.nc)
                   (Tmin=       -367.0000 Tmax=        633.0000)      t =        -67.0000
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)      regrid = F
    GET_2DFLD   - net longwave radiation flux,                     0000-10-26 00:00:00.00
                   (Grid=01, Rec=4, Index=1, File: roms_forcing_lrf_0627.nc)
                   (Tmin=       -367.0000 Tmax=        633.0000)      t =        -67.0000
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)      regrid = F
I've now check that I do not set ANA_STFLUX in my model. Is there any thing else that might block the model reading my shflux forcing file?
Here's my .h file setting

Code: Select all

#define UV_ADV
#define UV_COR
#define UV_QDRAG
#define UV_VIS2

#define MIX_S_UV
#define DJ_GRADPS
#define SPLINES_VDIFF
#define SPLINES_VVISC
#define TS_DIF2
#define MIX_GEO_TS

#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define WET_DRY

#define SPHERICAL
#define MASKING 
#define SALINITY
#define SOLVE3D

#define ANA_DIAG
#undef ANA_GRID
#undef ANA_INITIAL

#define BULK_FLUXES 

#ifdef BULK_FLUXES
# define ANA_WINDS
# define ANA_CLOUD
# define ANA_TAIR
# define ANA_HUMIDITY
# define ANA_PAIR
# define ATM_PRESS
# define PRESS_COMPENSATE
# define ANA_RAIN
#define EMINUSP        /* compute evaporation minus precipitation */
#endif

#define ANA_SMFLUX
#define ANA_BTFLUX
#define ANA_BSFLUX
#define ANA_SSFLUX

/* MIxing define */
#define GLS_MIXING

#if defined GLS_MIXING || defined MY25_MIXING
# undef KANTHA_CLAYSON
# define CANUTO_A
# undef N2S2_HORAVG
# undef RI_SPLINES
#else
# define ANA_VMIX
#endif
Thanks.

lfparejar
Posts: 15
Joined: Sat Oct 05, 2013 5:21 am
Location: Rutgers University

Re: Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

#4 Unread post by lfparejar »

One way to look at this is through your flags. Depending on your flags, forcing files may or may not be used.
You have:

Code: Select all

#define BULK_FLUXES 

#ifdef BULK_FLUXES
# define ANA_WINDS
# define ANA_CLOUD
# define ANA_TAIR
# define ANA_HUMIDITY
# define ANA_PAIR
# define ATM_PRESS
# define PRESS_COMPENSATE
# define ANA_RAIN
#define EMINUSP        /* compute evaporation minus precipitation */
#endif
which computes the surface heat fluxes and the wind stress. After that, you also have:

Code: Select all

#define ANA_SMFLUX
which computes the wind stress analytically. Is this intentional? Typically one picks either BULK_FLUXES or ANA_SMFLUX for the wind stress.
  • Do you need wind but no heat fluxes?
    If you do need to include a surface momentum flux, do force your model with wind speed or wind stress?
With ANA_STFLUX you can set surface tracer (e.g, temp, salt) fluxes to zero.
With ANA_SMFLUX you can set the surface wind stress (entered as a kinematic stress in units m2/s2)

hyc006
Posts: 24
Joined: Thu Nov 30, 2023 2:12 am
Location: UCSD

Re: Issue with ROMS Not Reading Forcing Files for Sensible Heat and Other Fluxes

#5 Unread post by hyc006 »

I believe I've identified why BULKFLUX prevents me from defining my own sea surface heat flux. However, I need BULKFLUX to set ANA_PAIR. I'm attempting to create a linear pressure gradient from north to south. To prevent changes in Pair due to the periodic condition, I disable boundary changes and define Pair at the edges. Here's my approach:

Code: Select all

#if defined SHALLOW || SHALLOWNI
  Cor_freq = -1.182E-05_r8
  Tilt_pressure = -0.2_r8 * Cor_freq * rho0 * 111.2_r8 * 1000_r8
  Mid_lat = -4.6741
  Mid_pressure = 1013.25_r8
  /* Fill the entire grid and disable periodic exchange, 
   * note the +2 in the DO loop ranges */
  DO j = JstrR-2, JendR+2
    DO i = IstrR-2, IendR+2
      Lat_move = latr(i, j) - Mid_lat
      /* 0.01 for 1 Pa = 0.01 mbar */
      Pair(i, j) = Mid_pressure + 0.01_r8 * Tilt_pressure * Lat_move
    END DO
  END DO
#else
  ana_pair.h: no values provided for Pair.
#endif
!
!  Exchange boundary data.
!
#if !defined SHALLOWNI
  /* In periodic applications, it is necessary to exchange boundary data 
   * to enforce periodicity. But in our shallow geotrophic flow, we don't want 
   * to do this because it disrupts grad(p) = spatially constant */
  IF (EWperiodic(ng) .or. NSperiodic(ng)) THEN
    CALL exchange_r2d_tile(ng, tile,                               &
                           LBi, UBi, LBj, UBj,                    &
                           Pair)
  END IF
#endif
I'm wondering if I can achieve this by creating a Pair forcing file while also defining Pair at the four edges of the boundary, rather than allowing the periodic condition to override it?

Post Reply