Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Zeng
Posts: 26
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#1 Unread post by Zeng »

Hellow, everyone!
I want to simulate the diffusion of some kind of liquid substance(dye, sewage or liquid metal salts etc..) in the ocean. After brief learning on the wiki website and forum, I think adding passive tracer into the run is a good way(probably?) . But I encountered some problems in this process.
In my simulation, I set the NPT to 1, and I choose to provide ini and bdry condition by the netCDF fiel. The strategy is as follow:
1. Modify the .h file
#define T_PASSIVE
#define ANA_BPFLUX
#define ANA_SPFLUX

2. Creat the varible 'dye_01', and write its initial values into ini.nc
-------------------------------------------------------------------------------------
dye_01
Size: 680x400x15x1
Dimensions: xi_rho,eta_rho,s_rho,ocean_time
Datatype: double
Attributes:
_FillValue = -30000
long_name = 'dye concentration, type 01'
units = 'kilogram meter-3'
field = 'dye_01, scalar, series'
--------------------------------------------------------------------------------------
For dye_01 initial values, I set the mass concentration of one sea surface cell to 1.0e+15, and the other cells are 0.

Code: Select all

>> a = ncread('HYCOM_GLBy0.08_2023_003_ic_ZHUSANJIAO.nc','dye_01') 
>> a(281,284,1,1)
ans =   1.000000000000000e+15
2. Creat the varibles, and write bdry values into bdry.nc
--------------------------------------------------------------------------
dye_time
Size: 59x1(I don't konw why set it as 59, but I just copy it from forum :oops: )
Dimensions: dye_time
Datatype: double
Attributes:
long_name = 'dye_time'
units = 'days'
field = 'dye_time, scalar, series'
--------------------------------------------------------------------------
dye_south_01
Size: 680x15x59
Dimensions: xi_rho,s_rho,dye_time
Datatype: double
Attributes:
long_name = 'dye concentration southern boundary condition,type 01'
units = 'kilogram meter-3'
field = 'dye_south_, scalar, series'
time = 'dye_time'
---------------------------------------------------------------------------
dye_east_01
Size: 400x15x59
Dimensions: eta_rho,s_rho,dye_time
Datatype: double
Attributes:
long_name = 'dye concentration eastern boundary condition,type 01'
units = 'kilogram meter-3'
field = 'dye_east_, scalar, series'
time = 'dye_time'
----------------------------------------------------------------------------
dye_north_01
Size: 680x15x59
Dimensions: xi_rho,s_rho,dye_time
Datatype: double
Attributes:
long_name = 'dye concentration northern boundary condition,type 01'
units = 'kilogram meter-3'
field = 'dye_north_, scalar, series'
time = 'dye_time'
-----------------------------------------------------------------------------
dye_west_01
Size: 400x15x59
Dimensions: eta_rho,s_rho,dye_time
Datatype: double
Attributes:
long_name = 'dye concentration western boundary condition,type 01'
units = 'kilogram meter-3'
field = 'dye_west_, scalar, series'
time = 'dye_time'
------------------------------------------------------------------------------
For bdry values, I set all cells to 0. Specifically, the source cell is show in the figure, the west side of the cell is land, and other three sides are ocean.
微信截图_20230314211804.png
Firstly, I set the bdry values for south, east and north sides, but ROMS reported an error:

Code: Select all

 unable to find requested variable: dye_west_01
    in file:               /home/zeng/roms/Projects/riverplume/data/bdry/HYCOM_GLBy0.08_2023_003_bdry_ZHUSANJIAO.nc
Therefore, I created 'dye_west_01' and provided boundary values for all four sides.

4. Creat the varible 'dye_01' in the ini.nc
-----------------------------------------------------------------------------
dye_01
Size: 680x400x15x1
Dimensions: xi_rho,eta_rho,s_rho,ocean_time
Datatype: double
Attributes:
_FillValue = -30000
long_name = 'dye concentration, type 01'
units = 'kilogram meter-3'
field = 'dye_01, scalar, series'
time = 'ocean_time'
----------------------------------------------------------------------------
I found some infomation about adding passive tracer from forum, and other users didn't creat the varible in clm.nc file. But if I didn't creat 'dye_01' in clm.nc, ROMS will report an error..


The program ran successfully. But when I pre-checked the results in Panoply, I found that the dye concentrantion is 0 everywhere(any time and any levels). There is also a problem with the salt calculation result: the concentration should not be 0..Does anyone know where the problem is and how to fix it?
dye concentration
dye concentration
salt concentration
salt concentration
The main content of my .in file is shown below.

Code: Select all

! Input variable information file name.  This file needs to be processed
! first so all information arrays can be initialized properly.

     VARNAME = /home/zeng/roms/Projects/riverplume/varinfo.yaml

! Number of nested grids.

      Ngrids =  1

! Number of grid nesting layers.  This parameter is used to allow refinement
! and composite grid combinations.

  NestLayers =  1

! Number of grids in each nesting layer [1:NestLayers].

GridsInLayer =  1

! Grid dimension parameters. See notes below in the Glossary for how to set
! these parameters correctly.

          Lm == 678            ! Number of I-direction INTERIOR RHO-points
          Mm == 398            ! Number of J-direction INTERIOR RHO-points
           N == 15            ! Number of vertical levels

        Nbed =  0             ! Number of sediment bed layers

         NAT =  2             ! Number of active tracers (usually, 2)
         NPT =  1             ! Number of inactive passive tracers
         NCS =  0             ! Number of cohesive (mud) sediment tracers
         NNS =  0             ! Number of non-cohesive (sand) sediment tracers

! Domain decomposition parameters for serial, distributed-memory or
! shared-memory configurations used to determine tile horizontal range
! indices (Istr,Iend) and (Jstr,Jend), [1:Ngrids].

      NtileI == 4                               ! I-direction partition
      NtileJ == 4                               ! J-direction partition

! Set horizontal and vertical advection schemes for active and inert
! tracers. A different advection scheme is allowed for each tracer.
! For example, a positive-definite (monotonic) algorithm can be activated
! for salinity and inert tracers, while a different one is set for
! temperature. [1:NAT+NPT,Ngrids] values are expected.
!
!   Keyword    Advection Algorithm
!
!   A4         4th-order Akima (horizontal/vertical)
!   C2         2nd-order centered differences (horizontal/vertical)
!   C4         4th-order centered differences (horizontal/vertical)
!   HSIMT      3th-order HSIMT-TVD (horizontal/vertical)
!   MPDATA     recursive flux corrected MPDATA (horizontal/vertical)
!   SPLINES    parabolic splines (only vertical)
!   SU3        split third-order upstream (horizontal/vertical)
!   U3         3rd-order upstream-biased (only horizontal)
!
! The user has the option of specifying the full Keyword or the first
! two letters, regardless if using uppercase or lowercase. If nested
! grids, specify values for each grid (see glossary below).

   Hadvection == U3       \                     ! temperature
                 HSIMT                          ! salinity

   Vadvection == C4       \                     ! temperature
                 HSIMT                          ! salinity

! Adjoint-based algorithms can have different horizontal and schemes
! for active and inert tracers.

ad_Hadvection == U3       \                     ! temperature
                 U3                             ! salinity

ad_Vadvection == C4       \                     ! temperature
                 C4                             ! salinity

! Set lateral boundary conditions keyword. Notice that a value is expected
! for each boundary segment per nested grid for each state variable.
!
! Each tracer variable requires [1:4,1:NAT+NPT,Ngrids] values. Otherwise,
! [1:4,1:Ngrids] values are expected for other variables. The boundary
! order is: 1=west, 2=south, 3=east, and 4=north. That is, anticlockwise
! starting at the western boundary.
!
! The keyword is case insensitive and usually has three characters. However,
! it is possible to have compound keywords, if applicable. For example, the
! keyword "RadNud" implies radiation boundary condition with nudging. This
! combination is usually used in active/passive radiation conditions.
!
!   Keyword    Lateral Boundary Condition Type
!
!   Cha        Chapman_implicit (free-surface)
!   Che        Chapman_explicit (free-surface)
!   Cla        Clamped
!   Clo        Closed
!   Fla        Flather (2D momentum)                  _____N_____     j=Mm
!   Gra        Gradient                              |     4     |
!   Nes        Nested (refinement)                   |           |
!   Nud        Nudging                             1 W           E 3
!   Per        Periodic                              |           |
!   Rad        Radiation                             |_____S_____|
!   Red        Reduced Physics (2D momentum)               2          j=1
!   Shc        Shchepetkin (2D momentum)            i=1         i=Lm
!
!                   W       S       E       N
!                   e       o       a       o
!                   s       u       s       r
!                   t       t       t       t
!                           h               h
!
!                   1       2       3       4

   LBC(isFsur) ==   Che     Che     Che     Che         ! free-surface
   LBC(isUbar) ==   Shc     Shc     Shc     Shc         ! 2D U-momentum
   LBC(isVbar) ==   Shc     Shc     Shc     Shc         ! 2D V-momentum
   LBC(isUvel) ==   RadNud  RadNud  RadNud  RadNud      ! 3D U-momentum
   LBC(isVvel) ==   RadNud  RadNud  RadNud  RadNud      ! 3D V-momentum
   LBC(isMtke) ==   Clo     Clo     Clo     Clo         ! mixing TKE

   LBC(isTvar) ==   RadNud  RadNud  RadNud  RadNud \    ! temperature
                    RadNud  RadNud  RadNud  RadNud \    ! salinity
                    RadNud  Cla     Cla     Cla         ! dye_01

! Adjoint-based algorithms can have different lateral boundary
! conditions keywords.

ad_LBC(isFsur) ==   Per     Clo     Per     Clo         ! free-surface
ad_LBC(isUbar) ==   Per     Clo     Per     Clo         ! 2D U-momentum
ad_LBC(isVbar) ==   Per     Clo     Per     Clo         ! 2D V-momentum
ad_LBC(isUvel) ==   Per     Clo     Per     Clo         ! 3D U-momentum
ad_LBC(isVvel) ==   Per     Clo     Per     Clo         ! 3D V-momentum
ad_LBC(isMtke) ==   Per     Clo     Per     Clo         ! mixing TKE

ad_LBC(isTvar) ==   Per     Clo     Per     Clo \       ! temperature
                    Per     Clo     Per     Clo \       ! salinity
                    Per     Cla     Cla     Cla         ! dye_01

! Set lateral open boundary edge volume conservation switch for
! nonlinear model and adjoint-based algorithms. Usually activated
! with radiation boundary conditions to enforce global mass
! conservation, except if tidal forcing is enabled. [1:Ngrids].

   VolCons(west)  ==  F                            ! western  boundary
   VolCons(east)  ==  F                            ! eastern  boundary
   VolCons(south) ==  F                            ! southern boundary
   VolCons(north) ==  F                            ! northern boundary

ad_VolCons(west)  ==  F                            ! western  boundary
ad_VolCons(east)  ==  F                            ! eastern  boundary
ad_VolCons(south) ==  F                            ! southern boundary
ad_VolCons(north) ==  F                            ! northern boundary

! Time-Stepping parameters.

      NTIMES == 360
          DT == 20.0d0
     NDTFAST == 20

! Number of timesteps for computing observation impacts during the
! analysis-forecast cycle.

  NTIMES_ANA == 0                              ! analysis interval
  NTIMES_FCT == 0                              ! forecast interval

! Model iteration loops parameters.

       ERstr =  1
       ERend =  1
      Nouter =  1
      Ninner =  1
     Nsaddle =  1
  Nintervals =  1

! Number of eigenvalues (NEV) and eigenvectors (NCV) to compute for the
! Lanczos/Arnoldi problem in the Generalized Stability Theory (GST)
! analysis. NCV must be greater than NEV (see documentation below).

         NEV =  2                               ! Number of eigenvalues
         NCV =  10                              ! Number of eigenvectors

! Input/Output parameters.

       NRREC == 0
   LcycleRST == T
        NRST == 60
        NSTA == 1
        NFLT == 0
       NINFO == 1

! Output history, quicksave, average, and diagnostic files parameters.

     LDEFOUT == T
        NHIS == 60      ! hourly
     NDEFHIS == 0
        NQCK == 0
     NDEFQCK == 0
      NTSAVG == 1
        NAVG == 60
     NDEFAVG == 0
      NTSDIA == 1
        NDIA == 60
     NDEFDIA == 0

! Output tangent linear and adjoint models parameters.

   LcycleTLM == F
        NTLM == 60
     NDEFTLM == 0
   LcycleADJ == F
        NADJ == 60
     NDEFADJ == 0
        NSFF == 60
        NOBC == 60

! GST output and check pointing restart parameters.

   LmultiGST =  F                               ! one eigenvector per file
     LrstGST =  F                               ! GST restart switch
  MaxIterGST =  500                             ! maximum number of iterations
        NGST =  10                              ! check pointing interval

! Relative accuracy of the Ritz values computed in the GST analysis.

    Ritz_tol =  1.0d-15

! Harmonic/biharmonic horizontal diffusion of tracer for nonlinear model
! and adjoint-based algorithms: [1:NAT+NPT,Ngrids].

        TNU2 == 8*5.0d0                         ! m2/s
        TNU4 == 8*0.0d0                         ! m4/s

     ad_TNU2 == 0.0d0  0.0d0                    ! m2/s
     ad_TNU4 == 0.0d0  0.0d0                    ! m4/s

! Harmonic/biharmonic, horizontal viscosity coefficient for nonlinear model
! and adjoint-based algorithms: [Ngrids].

       VISC2 == 1.5d0                          ! m2/s
       VISC4 == 0.0d0                           ! m4/s

    ad_VISC2 == 0.0d0                           ! m2/s
    ad_VISC4 == 0.0d0                           ! m4/s

! Logical switches (TRUE/FALSE) to increase/decrease horizontal viscosity
! and/or diffusivity in specific areas of the application domain (like
! sponge areas) for the desired application grid.

    LuvSponge == F                              ! horizontal momentum
LtracerSponge == F F F                          ! temperature, salinity, inert

! Vertical mixing coefficients for tracers in nonlinear model and
! basic state scale factor in adjoint-based algorithms: [1:NAT+NPT,Ngrids]

     AKT_BAK == 8*1.0d-6                        ! m2/s

  ad_AKT_fac == 1.0d0 1.0d0 1.0d0               ! nondimensional

! Vertical mixing coefficient for momentum for nonlinear model and
! basic state scale factor in adjoint-based algorithms: [Ngrids].

     AKV_BAK == 1.0d-5                          ! m2/s

  ad_AKV_fac == 1.0d0                           ! nondimensional

! Upper threshold values to limit vertical mixing coefficients computed
! from vertical mixing parameterizations. Although this is an engineering
! fix, the vertical mixing values inferred from ocean observations are
! rarely higher than this upper limit value.

   AKT_LIMIT == 1.0d-3 1.0d-3 1.0d-3            ! m2/s

   AKV_LIMIT == 1.0d-3                          ! m2/s

! Turbulent closure parameters.

     AKK_BAK == 5.0d-6                          ! m2/s
     AKP_BAK == 5.0d-6                          ! m2/s
      TKENU2 == 0.0d0                           ! m2/s
      TKENU4 == 0.0d0                           ! m4/s

! Generic length-scale turbulence closure parameters.

       GLS_P == -1.0d0                           ! K-omega
       GLS_M == 0.5d0
       GLS_N == -1.0d0
    GLS_Kmin == 7.6d-6
    GLS_Pmin == 1.0d-12

    GLS_CMU0 == 0.5477d0
      GLS_C1 == 0.555d0
      GLS_C2 == 0.833d0
     GLS_C3M == -0.6d0
     GLS_C3P == 1.0d0
    GLS_SIGK == 2.0d0
    GLS_SIGP == 2.0d0

! Constants used in surface turbulent kinetic energy flux computation.

  CHARNOK_ALPHA == 1400.0d0         ! Charnok surface roughness
 ZOS_HSIG_ALPHA == 0.5d0            ! roughness from wave amplitude
       SZ_ALPHA == 0.25d0           ! roughness from wave dissipation
      CRGBAN_CW == 100.0d0          ! Craig and Banner wave breaking

! Constants used in momentum stress computation.

        RDRG == 3.0d-04                    ! m/s
       RDRG2 == 3.0d-03                    ! nondimensional
         Zob == 0.02d0                     ! m
         Zos == 0.02d0                     ! m

! Height (m) of atmospheric measurements for Bulk fluxes parameterization.

      BLK_ZQ == 2.0d0                     ! air humidity
      BLK_ZT == 2.0d0                     ! air temperature
      BLK_ZW == 2.0d0                     ! winds

! Minimum depth for wetting and drying.

       DCRIT == 0.50d0                     ! m

! Various parameters.

       WTYPE == 1
     LEVSFRC == 15
     LEVBFRC == 1

! Set vertical, terrain-following coordinates transformation equation and
! stretching function (see below for details), [1:Ngrids].

  Vtransform == 2                          ! transformation equation
 Vstretching == 4                          ! stretching function

! Vertical S-coordinates parameters (see below for details), [1:Ngrids].

     THETA_S == 8.0d0                      ! surface stretching parameter
     THETA_B == 4.0d0                      ! bottom  stretching parameter
      TCLINE == 20.0d0                     ! critical depth (m)

! Mean Density and Brunt-Vaisala frequency.

        RHO0 =  1025.0d0                   ! kg/m3
     BVF_BAK =  1.0d-5                     ! 1/s2

! If tide generating forces, set switch (T/F) to apply a 18.6-year lunar
! nodal correction to equilibrium tide constituents.

      Lnodal =  T

! Time-stamp assigned for model initialization, reference time
! origin for tidal forcing, and model reference time for output
! NetCDF units attribute.

      DSTART =  0.0d0                      ! days
  TIDE_START =  0.0d0                      ! days
    TIME_REF =  0.0d0                      ! yyyymmdd.dd

! Nudging/relaxation time scales, inverse scales will be computed
! internally, [1:Ngrids].

       TNUDG == 2*0.0d0                    ! days
       ZNUDG == 0.0d0                      ! days
      M2NUDG == 0.0d0                      ! days
      M3NUDG == 0.0d0                      ! days

! Factor between passive (outflow) and active (inflow) open boundary
! conditions, [1:Ngrids]. If OBCFAC > 1, nudging on inflow is stronger
! than on outflow (recommended).

      OBCFAC == 0.0d0                      ! nondimensional

! Linear equation of State parameters:

          R0 == 1027.0d0                   ! kg/m3
          T0 == 25.0d0                     ! Celsius
          S0 == 35.0d0                     ! nondimensional
       TCOEF == 1.7d-4                     ! 1/Celsius
       SCOEF == 7.6d-4                     ! nondimensional

! Slipperiness parameter: 1.0 (free slip) or -1.0 (no slip)

      GAMMA2 == -1.0d0

! Logical switches (TRUE/FALSE) to activate horizontal momentum transport
! point Sources/Sinks (like river runoff transport) and mass point
! Sources/Sinks (like volume vertical influx), [1:Ngrids].

      LuvSrc == F                          ! horizontal momentum transport
       LwSrc == F                          ! volume vertical influx

! Logical switches (TRUE/FALSE) to activate tracers point Sources/Sinks
! (like river runoff) and to specify which tracer variables to consider:
! [1:NAT+NPT,Ngrids].  See glossary below for details.

  LtracerSrc == F F F                      ! temperature, salinity, inert

! Logical switches (TRUE/FALSE) to read and process climatology fields.
! See glossary below for details.

     LsshCLM == F                          ! sea-surface height
      Lm2CLM == T                          ! 2D momentum
      Lm3CLM == T                          ! 3D momentum

  LtracerCLM == T T T                      ! temperature, salinity, inert

! Logical switches (TRUE/FALSE) to nudge the desired climatology field(s).
! If not analytical climatology fields, users need to turn ON the logical
! switches above to process the fields from the climatology NetCDF file
! that are needed for nudging. See glossary below for details.

 LnudgeM2CLM == F                          ! 2D momentum
 LnudgeM3CLM == F                          ! 3D momentum

  LnudgeTCLM == F F F                      ! temperature, salinity, inert

! Starting (DstrS) and ending (DendS) day for adjoint sensitivity forcing.
! DstrS must be less or equal to DendS. If both values are zero, their
! values are reset internally to the full range of the adjoint integration.

       DstrS == 0.0d0                      ! starting day
       DendS == 0.0d0                      ! ending day

! Starting and ending vertical levels of the 3D adjoint state variables
! whose sensitivity is required.

       KstrS == 1                          ! starting level
       KendS == 1                          ! ending level

! Logical switches (TRUE/FALSE) to specify the adjoint state variables
! whose sensitivity is required.

Lstate(isFsur) == F                        ! free-surface
Lstate(isUbar) == F                        ! 2D U-momentum
Lstate(isVbar) == F                        ! 2D V-momentum
Lstate(isUvel) == F                        ! 3D U-momentum
Lstate(isVvel) == F                        ! 3D V-momentum
Lstate(isWvel) == F                        ! 3D W-momentum

Lstate(isTvar) == F F F                    ! NT tracers

! Logical switches (TRUE/FALSE) to specify the state variables for
! which Forcing Singular Vectors or Stochastic Optimals is required.

Fstate(isFsur) == F                        ! free-surface
Fstate(isUbar) == F                        ! 2D U-momentum
Fstate(isVbar) == F                        ! 2D V-momentum
Fstate(isUvel) == F                        ! 3D U-momentum
Fstate(isVvel) == F                        ! 3D V-momentum
Fstate(isTvar) == F F F                    ! NT tracers

Fstate(isUstr) == T                        ! surface U-stress
Fstate(isVstr) == T                        ! surface V-stress
Fstate(isTsur) == F F F                    ! NT surface tracers flux

! Stochastic Optimals time decorrelation scale (days) assumed for
! red noise processes.

      SO_decay == 2.0d0                    ! days

! Stochastic Optimals surface forcing standard deviation for
! dimensionalization.

SO_sdev(isFsur) == 1.0d0                   ! free-surface
SO_sdev(isUbar) == 1.0d0                   ! 2D U-momentum
SO_sdev(isVbar) == 1.0d0                   ! 2D V-momentum
SO_sdev(isUvel) == 1.0d0                   ! 3D U-momentum
SO_sdev(isVvel) == 1.0d0                   ! 3D V-momentum
SO_sdev(isTvar) == 1.0d0 1.0d0 1.0d0       ! NT tracers

SO_sdev(isUstr) == 1.0d0                   ! surface U-stress
SO_sdev(isVstr) == 1.0d0                   ! surface V-stress
SO_sdev(isTsur) == 1.0d0 1.0d0 1.0d0       ! NT surface tracers flux

! Logical switches (TRUE/FALSE) to activate writing of fields into
! HISTORY output file.

Hout(idUvel) == T       ! u                  3D U-velocity
Hout(idVvel) == T       ! v                  3D V-velocity
Hout(idu3dE) == F       ! u_eastward         3D U-eastward  at RHO-points
Hout(idv3dN) == F       ! v_northward        3D V-northward at RHO-points
Hout(idWvel) == T       ! w                  3D W-velocity
Hout(idOvel) == T       ! omega              omega vertical velocity
Hout(idUbar) == T       ! ubar               2D U-velocity
Hout(idVbar) == T       ! vbar               2D V-velocity
Hout(idu2dE) == F       ! ubar_eastward      2D U-eastward  at RHO-points
Hout(idv2dN) == F       ! vbar_northward     2D V-northward at RHO-points
Hout(idFsur) == T       ! zeta               free-surface
Hout(idBath) == T       ! bath               time-dependent bathymetry

Hout(idTvar) == T T T   ! temp, salt         temperature and salinity

Hout(idpthR) == F       ! z_rho              time-varying depths of RHO-points
Hout(idpthU) == F       ! z_u                time-varying depths of U-points
Hout(idpthV) == F       ! z_v                time-varying depths of V-points
Hout(idpthW) == F       ! z_w                time-varying depths of W-points

Hout(idUsms) == F       ! sustr              surface U-stress
Hout(idVsms) == F       ! svstr              surface V-stress
Hout(idUbms) == F       ! bustr              bottom U-stress
Hout(idVbms) == F       ! bvstr              bottom V-stress

Hout(idUbrs) == F       ! bustrc             bottom U-current stress
Hout(idVbrs) == F       ! bvstrc             bottom V-current stress
Hout(idUbws) == F       ! bustrw             bottom U-wave stress
Hout(idVbws) == F       ! bvstrw             bottom V-wave stress
Hout(idUbcs) == F       ! bustrcwmax         bottom max wave-current U-stress
Hout(idVbcs) == F       ! bvstrcwmax         bottom max wave-current V-stress

Hout(idUbot) == F       ! Ubot               bed wave orbital U-velocity
Hout(idVbot) == F       ! Vbot               bed wave orbital V-velocity
Hout(idUbur) == F       ! Ur                 bottom U-velocity above bed
Hout(idVbvr) == F       ! Vr                 bottom V-velocity above bed

Hout(idW2xx) == F       ! Sxx_bar            2D radiation stress, Sxx component
Hout(idW2xy) == F       ! Sxy_bar            2D radiation stress, Sxy component
Hout(idW2yy) == F       ! Syy_bar            2D radiation stress, Syy component
Hout(idU2rs) == F       ! Ubar_Rstress       2D radiation U-stress
Hout(idV2rs) == F       ! Vbar_Rstress       2D radiation V-stress
Hout(idU2Sd) == F       ! ubar_stokes        2D U-Stokes velocity
Hout(idV2Sd) == F       ! vbar_stokes        2D V-Stokes velocity

Hout(idW3xx) == F       ! Sxx                3D radiation stress, Sxx component
Hout(idW3xy) == F       ! Sxy                3D radiation stress, Sxy component
Hout(idW3yy) == F       ! Syy                3D radiation stress, Syy component
Hout(idW3zx) == F       ! Szx                3D radiation stress, Szx component
Hout(idW3zy) == F       ! Szy                3D radiation stress, Szy component
Hout(idU3rs) == F       ! u_Rstress          3D U-radiation stress
Hout(idV3rs) == F       ! v_Rstress          3D V-radiation stress
Hout(idU3Sd) == F       ! u_stokes           3D U-Stokes velocity
Hout(idV3Sd) == F       ! v_stokes           3D V-Stokes velocity

Hout(idWamp) == F       ! Hwave              wave height
Hout(idWlen) == F       ! Lwave              wave length
Hout(idWdir) == F       ! Dwave              wave direction
Hout(idWptp) == F       ! Pwave_top          wave surface period
Hout(idWpbt) == F       ! Pwave_bot          wave bottom period
Hout(idWorb) == F       ! Ub_swan            wave bottom orbital velocity
Hout(idWdis) == F       ! Wave_dissip        wave dissipation

Hout(idPair) == F       ! Pair               surface air pressure
Hout(idTair) == F       ! Tair               surface air temperature
Hout(idUair) == F       ! Uair               surface U-wind component
Hout(idVair) == F       ! Vair               surface V-wind component

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

Hout(idDano) == T       ! rho                density anomaly
Hout(idVvis) == T       ! AKv                vertical viscosity
Hout(idTdif) == T       ! AKt                vertical T-diffusion
Hout(idSdif) == T       ! AKs                vertical Salinity diffusion
Hout(idHsbl) == T       ! Hsbl               depth of surface boundary layer
Hout(idHbbl) == T       ! Hbbl               depth of bottom boundary layer
Hout(idMtke) == T       ! tke                turbulent kinetic energy
Hout(idMtls) == T       ! gls                turbulent length scale

! Logical switches (TRUE/FALSE) to activate writing of extra inert passive
! tracers other than biological and sediment tracers into the HISTORY
! output file. An inert passive tracer is one that it is only advected and
! diffused. Other processes are ignored. These tracers include, for example,
! dyes, pollutants, oil spills, etc. NPT values are expected. However, these
! switches can be activated using compact parameter specification.

 Hout(inert) == T       ! dye_01, ...        inert passive tracers

! Logical switches (TRUE/FALSE) to activate writing of fields into
! QUICKSAVE output file.

Qout(idUvel) == F       ! u                  3D U-velocity
Qout(idVvel) == F       ! v                  3D V-velocity
Qout(idu3dE) == F       ! u_eastward         3D U-eastward  at RHO-points
Qout(idv3dN) == F       ! v_northward        3D V-northward at RHO-points
Qout(idWvel) == F       ! w                  3D W-velocity
Qout(idOvel) == F       ! omega              omega vertical velocity
Qout(idUbar) == T       ! ubar               2D U-velocity
Qout(idVbar) == T       ! vbar               2D V-velocity
Qout(idu2dE) == T       ! ubar_eastward      2D U-eastward  at RHO-points
Qout(idv2dN) == T       ! vbar_northward     2D V-northward at RHO-points
Qout(idFsur) == T       ! zeta               free-surface
Qout(idBath) == T       ! bath               time-dependent bathymetry

Qout(idTvar) == F F     ! temp, salt         temperature and salinity

Qout(idUsur) == T       ! u_sur              surface U-velocity
Qout(idVsur) == T       ! v_sur              surface V-velocity
Qout(idUsuE) == T       ! u_sur_eastward     surface U-eastward  velocity
Qout(idVsuN) == T       ! v_sur_northward    surface V-northward velocity

Qout(idsurT) == T T     ! temp_sur, salt_sur surface temperature and salinity

Qout(idpthR) == F       ! z_rho              time-varying depths of RHO-points
Qout(idpthU) == F       ! z_u                time-varying depths of U-points
Qout(idpthV) == F       ! z_v                time-varying depths of V-points
Qout(idpthW) == F       ! z_w                time-varying depths of W-points

Qout(idUsms) == F       ! sustr              surface U-stress
Qout(idVsms) == F       ! svstr              surface V-stress
Qout(idUbms) == F       ! bustr              bottom U-stress
Qout(idVbms) == F       ! bvstr              bottom V-stress

Qout(idUbrs) == F       ! bustrc             bottom U-current stress
Qout(idVbrs) == F       ! bvstrc             bottom V-current stress
Qout(idUbws) == F       ! bustrw             bottom U-wave stress
Qout(idVbws) == F       ! bvstrw             bottom V-wave stress
Qout(idUbcs) == F       ! bustrcwmax         bottom max wave-current U-stress
Qout(idVbcs) == F       ! bvstrcwmax         bottom max wave-current V-stress

Qout(idUbot) == F       ! Ubot               bed wave orbital U-velocity
Qout(idVbot) == F       ! Vbot               bed wave orbital V-velocity
Qout(idUbur) == F       ! Ur                 bottom U-velocity above bed
Qout(idVbvr) == F       ! Vr                 bottom V-velocity above bed

Qout(idW2xx) == F       ! Sxx_bar            2D radiation stress, Sxx component
Qout(idW2xy) == F       ! Sxy_bar            2D radiation stress, Sxy component
Qout(idW2yy) == F       ! Syy_bar            2D radiation stress, Syy component
Qout(idU2rs) == F       ! Ubar_Rstress       2D radiation U-stress
Qout(idV2rs) == F       ! Vbar_Rstress       2D radiation V-stress
Qout(idU2Sd) == F       ! ubar_stokes        2D U-Stokes velocity
Qout(idV2Sd) == F       ! vbar_stokes        2D V-Stokes velocity

Qout(idW3xx) == F       ! Sxx                3D radiation stress, Sxx component
Qout(idW3xy) == F       ! Sxy                3D radiation stress, Sxy component
Qout(idW3yy) == F       ! Syy                3D radiation stress, Syy component
Qout(idW3zx) == F       ! Szx                3D radiation stress, Szx component
Qout(idW3zy) == F       ! Szy                3D radiation stress, Szy component
Qout(idU3rs) == F       ! u_Rstress          3D U-radiation stress
Qout(idV3rs) == F       ! v_Rstress          3D V-radiation stress
Qout(idU3Sd) == F       ! u_stokes           3D U-Stokes velocity
Qout(idV3Sd) == F       ! v_stokes           3D V-Stokes velocity

Qout(idWamp) == F       ! Hwave              wave height
Qout(idWlen) == F       ! Lwave              wave length
Qout(idWdir) == F       ! Dwave              wave direction
Qout(idWptp) == F       ! Pwave_top          wave surface period
Qout(idWpbt) == F       ! Pwave_bot          wave bottom period
Qout(idWorb) == F       ! Ub_swan            wave bottom orbital velocity
Qout(idWdis) == F       ! Wave_dissip        wave dissipation

Qout(idPair) == F       ! Pair               surface air pressure
Qout(idTair) == F       ! Tair               surface air temperature
Qout(idUair) == F       ! Uair               surface U-wind component
Qout(idVair) == F       ! Vair               surface V-wind component

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

Qout(idDano) == F       ! rho                density anomaly
Qout(idVvis) == F       ! AKv                vertical viscosity
Qout(idTdif) == F       ! AKt                vertical T-diffusion
Qout(idSdif) == F       ! AKs                vertical Salinity diffusion
Qout(idHsbl) == F       ! Hsbl               depth of surface boundary layer
Qout(idHbbl) == F       ! Hbbl               depth of bottom boundary layer
Qout(idMtke) == F       ! tke                turbulent kinetic energy
Qout(idMtls) == F       ! gls                turbulent length scale

! Logical switches (TRUE/FALSE) to activate writing of extra inert passive
! tracers other than biological and sediment tracers into the QUICKSAVE
! output file. An inert passive tracer is one that it is only advected and
! diffused. Other processes are ignored. These tracers include, for example,
! dyes, pollutants, oil spills, etc. NPT values are expected. However, these
! switches can be activated using compact parameter specification.

 Qout(inert) == T       ! dye_01, ...        inert passive tracers
 Qout(Snert) == T       ! dye_01_sur, ...    surface inert passive tracers

! Logical switches (TRUE/FALSE) to activate writing of time-averaged
! fields into AVERAGE output file.

Aout(idUvel) == T       ! u                  3D U-velocity
Aout(idVvel) == T       ! v                  3D V-velocity
Aout(idu3dE) == F       ! u_eastward         3D U-eastward  at RHO-points
Aout(idv3dN) == F       ! v_northward        3D V-northward at RHO-points
Aout(idWvel) == T       ! w                  3D W-velocity
Aout(idOvel) == T       ! omega              omega vertical velocity
Aout(idUbar) == T       ! ubar               2D U-velocity
Aout(idVbar) == T       ! vbar               2D V-velocity
Aout(idu2dE) == F       ! ubar_eastward      2D U-eastward  at RHO-points
Aout(idv2dN) == F       ! vbar_northward     2D V-northward at RHO-points
Aout(idFsur) == T       ! zeta               free-surface

Aout(idTvar) == T T     ! temp, salt         temperature and salinity

Aout(idUsms) == F       ! sustr              surface U-stress
Aout(idVsms) == F       ! svstr              surface V-stress
Aout(idUbms) == F       ! bustr              bottom U-stress
Aout(idVbms) == F       ! bvstr              bottom V-stress

Aout(idW2xx) == F       ! Sxx_bar            2D radiation stress, Sxx component
Aout(idW2xy) == F       ! Sxy_bar            2D radiation stress, Sxy component
Aout(idW2yy) == F       ! Syy_bar            2D radiation stress, Syy component
Aout(idU2rs) == F       ! Ubar_Rstress       2D radiation U-stress
Aout(idV2rs) == F       ! Vbar_Rstress       2D radiation V-stress
Aout(idU2Sd) == F       ! ubar_stokes        2D U-Stokes velocity
Aout(idV2Sd) == F       ! vbar_stokes        2D V-Stokes velocity

Aout(idW3xx) == F       ! Sxx                3D radiation stress, Sxx component
Aout(idW3xy) == F       ! Sxy                3D radiation stress, Sxy component
Aout(idW3yy) == F       ! Syy                3D radiation stress, Syy component
Aout(idW3zx) == F       ! Szx                3D radiation stress, Szx component
Aout(idW3zy) == F       ! Szy                3D radiation stress, Szy component
Aout(idU3rs) == F       ! u_Rstress          3D U-radiation stress
Aout(idV3rs) == F       ! v_Rstress          3D V-radiation stress
Aout(idU3Sd) == F       ! u_stokes           3D U-Stokes velocity
Aout(idV3Sd) == F       ! v_stokes           3D V-Stokes velocity

Aout(idPair) == F       ! Pair               surface air pressure
Aout(idTair) == F       ! Tair               surface air temperature
Aout(idUair) == F       ! Uair               surface U-wind component
Aout(idVair) == F       ! Vair               surface V-wind component

Aout(idTsur) == F F     ! shflux, ssflux     surface net heat and salt flux
Aout(idLhea) == F       ! latent             latent heat flux
Aout(idShea) == F       ! sensible           sensible heat flux
Aout(idLrad) == F       ! lwrad              longwave radiation flux
Aout(idSrad) == F       ! swrad              shortwave radiation flux
Aout(idevap) == F       ! evaporation        evaporation rate
Aout(idrain) == F       ! rain               precipitation rate

Aout(idDano) == F       ! rho                density anomaly
Aout(idVvis) == F       ! AKv                vertical viscosity
Aout(idTdif) == F       ! AKt                vertical T-diffusion
Aout(idSdif) == F       ! AKs                vertical Salinity diffusion
Aout(idHsbl) == F       ! Hsbl               depth of surface boundary layer
Aout(idHbbl) == F       ! Hbbl               depth of bottom boundary layer

Aout(id2dRV) == F       ! pvorticity_bar     2D relative vorticity
Aout(id3dRV) == F       ! pvorticity         3D relative vorticity
Aout(id2dPV) == F       ! rvorticity_bar     2D potential vorticity
Aout(id3dPV) == F       ! rvorticity         3D potential vorticity

Aout(idu3dD) == F       ! u_detided          detided 3D U-velocity
Aout(idv3dD) == F       ! v_detided          detided 3D V-velocity
Aout(idu2dD) == F       ! ubar_detided       detided 2D U-velocity
Aout(idv2dD) == F       ! vbar_detided       detided 2D V-velocity
Aout(idFsuD) == F       ! zeta_detided       detided free-surface

Aout(idTrcD) == F F     ! temp_detided, ...  detided temperature and salinity

Aout(idHUav) == F       ! Huon               u-volume flux, Huon
Aout(idHVav) == F       ! Hvom               v-volume flux, Hvom
Aout(idUUav) == F       ! uu                 quadratic <u*u> term
Aout(idUVav) == F       ! uv                 quadratic <u*v> term
Aout(idVVav) == F       ! vv                 quadratic <v*v> term
Aout(idU2av) == F       ! ubar2              quadratic <ubar*ubar> term
Aout(idV2av) == F       ! vbar2              quadratic <vbar*vbar> term
Aout(idZZav) == F       ! zeta2              quadratic <zeta*zeta> term

Aout(idTTav) == F F     ! temp_2, ...        quadratic <t*t> tracer terms
Aout(idUTav) == F F     ! u_temp, ...        quadratic <u*t> tracer terms
Aout(idVTav) == F F     ! v_temp, ...        quadratic <v*t> tracer terms
Aout(iHUTav) == F F     ! Huon_temp, ...     tracer volume flux, <Huon*t>
Aout(iHVTav) == F F     ! Hvom_temp, ...     tracer volume flux, <Hvom*t>

! Logical switches (TRUE/FALSE) to activate writing of extra inert passive
! tracers other than biological and sediment tracers into the AVERAGE file.

 Aout(inert) == T       ! dye_01, ...        inert passive tracers

! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
! 2D momentum (ubar,vbar) diagnostic terms into DIAGNOSTIC output file.

Dout(M2rate) == T       ! ubar_accel, ...    acceleration
Dout(M2pgrd) == T       ! ubar_prsgrd, ...   pressure gradient
Dout(M2fcor) == T       ! ubar_cor, ...      Coriolis force
Dout(M2hadv) == T       ! ubar_hadv, ...     horizontal total advection
Dout(M2xadv) == T       ! ubar_xadv, ...     horizontal XI-advection
Dout(M2yadv) == T       ! ubar_yadv, ...     horizontal ETA-advection
Dout(M2hrad) == T       ! ubar_hrad, ...     horizontal total radiation stress
Dout(M2hvis) == T       ! ubar_hvisc, ...    horizontal total viscosity
Dout(M2xvis) == T       ! ubar_xvisc, ...    horizontal XI-viscosity
Dout(M2yvis) == T       ! ubar_yvisc, ...    horizontal ETA-viscosity
Dout(M2sstr) == T       ! ubar_sstr, ...     surface stress
Dout(M2bstr) == T       ! ubar_bstr, ...     bottom stress

! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
! 3D momentum (u,v) diagnostic terms into DIAGNOSTIC output file.

Dout(M3rate) == T       ! u_accel, ...       acceleration
Dout(M3pgrd) == T       ! u_prsgrd, ...      pressure gradient
Dout(M3fcor) == T       ! u_cor, ...         Coriolis force
Dout(M3hadv) == T       ! u_hadv, ...        horizontal total advection
Dout(M3xadv) == T       ! u_xadv, ...        horizontal XI-advection
Dout(M3yadv) == T       ! u_yadv, ...        horizontal ETA-advection
Dout(M3vadv) == T       ! u_vadv, ...        vertical advection
Dout(M3hrad) == T       ! u_hrad, ...        horizontal total radiation stress
Dout(M3vrad) == T       ! u_vrad, ...        vertical radiation stress
Dout(M3hvis) == T       ! u_hvisc, ...       horizontal total viscosity
Dout(M3xvis) == T       ! u_xvisc, ...       horizontal XI-viscosity
Dout(M3yvis) == T       ! u_yvisc, ...       horizontal ETA-viscosity
Dout(M3vvis) == T       ! u_vvisc, ...       vertical viscosity

! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
! active (temperature and salinity) and passive (inert) tracer diagnostic
! terms into DIAGNOSTIC output file: [1:NAT+NPT,Ngrids].

Dout(iTrate) == T T T   ! temp_rate, ...     time rate of change
Dout(iThadv) == T T T   ! temp_hadv, ...     horizontal total advection
Dout(iTxadv) == T T T   ! temp_xadv, ...     horizontal XI-advection
Dout(iTyadv) == T T T   ! temp_yadv, ...     horizontal ETA-advection
Dout(iTvadv) == T T T   ! temp_vadv, ...     vertical advection
Dout(iThdif) == T T T   ! temp_hdiff, ...    horizontal total diffusion
Dout(iTxdif) == T T T   ! temp_xdiff, ...    horizontal XI-diffusion
Dout(iTydif) == T T T   ! temp_ydiff, ...    horizontal ETA-diffusion
Dout(iTsdif) == T T T   ! temp_sdiff, ...    horizontal S-diffusion
Dout(iTvdif) == T T T   ! temp_vdiff, ...    vertical diffusion

! Generic User parameters, [1:NUSER].

       NUSER =  0
        USER =  0.d0

! Input and Output files processing library to use:
!
!   [1] Standard NetCDF-3 or NetCDF-4 library
!   [2] Serial or Parallel I/O with Parallel-IO (PIO) library (MPI only)

     INP_LIB =  1
     OUT_LIB =  1

! PIO library methods for reading/writing NetCDF files:
!
!   [0] parallel read and write of PnetCDF (CDF-5, not recommended)
!   [1] parallel read and write of NetCDF3 (64-bit offset)
!   [2] serial   read and write of NetCDF3 (64-bit offset)
!   [3] parallel read and serial write of NetCDF4/HDF5
!   [4] parallel read and write of NETCDF4/HDF5

  PIO_METHOD =  2

! PIO library MPI processes set-up:

 PIO_IOTASKS =  1                 ! number of I/O tasks to define
  PIO_STRIDE =  1                 ! stride in the MPI-ran between I/O tasks
    PIO_BASE =  0                 ! offset for the first I/O task
  PIO_AGGREG =  1                 ! number of MPI-aggregators to use

! PIO library rearranger methods for moving data between computational and I/O
! processes:
!
!   [1] Box rearrangement
!   [2] Subset rearrangement

   PIO_REARR =  1

! PIO library rearranger flag for MPI communications between computational
! and I/O processes:
!
!   [0] Point-to-Point (low-level communications)
!   [1] Collective (high-level grouped communications)

PIO_REARRCOM =  0

! PIO library rearranger flow control direction flag for MPI communications
! between computational and I/O processes:
!
!   [0] Enable computational to I/O processes, and vice versa
!   [2] Enable computational to I/O processes only
!   [3] Enable I/O to computational processes only
!   [4] Disable flow control

PIO_REARRDIR = 0

! PIO rearranger options for computational to I/O processes (C2I):

  PIO_C2I_HS = T                  ! Enable C2I handshake (T/F)
PIO_C2I_Send = T                  ! Enable C2I Isends (T/F)
PIO_C2I_Preq = 64                 ! Maximum pending C2I requests

! PIO rearranger options for I/O to computational processes (I2C):

  PIO_I2C_HS = T                  ! Enable I2C handshake (T/F)
PIO_I2C_Send = T                  ! Enable I2C Isends (T/F)
PIO_I2C_Preq = 65                 ! Maximum pending I2C requests

! If OUT_LIB=1, NetCDF-4/HDF5 compression parameters for output files.

  NC_SHUFFLE =  1                 ! if non-zero, turn on shuffle filter
  NC_DEFLATE =  1                 ! if non-zero, turn on deflate filter
   NC_DLEVEL =  1                 ! deflate level [0-9]

! Input NetCDF file names, [1:Ngrids].

     GRDNAME == /home/zeng/roms/Projects/zhusanjiao/upwelling/zhusanjiao_grid_0.5km.nc
     ININAME == /home/zeng/roms/Projects/riverplume/data/ic/HYCOM_GLBy0.08_2023_003_ic_ZHUSANJIAO.nc
     ITLNAME == roms_itl.nc
     IRPNAME == roms_irp.nc
     IADNAME == roms_iad.nc
     FWDNAME == roms_fwd.nc
     ADSNAME == roms_ads.nc

! Input adjoint forcing NetCDF filenames for computing observations
! impacts during the analysis-forecast cycle. If the forecast error
! metric is defined in state-space, then FOInameA and FOInameB should
! be regular adjoint forcing files just like ADSname. If the forecast
! error metric is defined in observation space (OBS_SPACE is activated)
! then the forecast is initialized OIFnameA and OIFnameB (specified in
! s4dvar.in input script) will have the structure of a 4D-Var observation
! file.

    FOInameA == roms_foi_a.nc
    FOInameB == roms_foi_b.nc

! Input NetCDF filenames for the forecasts initialized from the analysis
! of the current 4D-Var cycle (FCTnameA) and initialized from the analysis
! of the previous 4D-Var cycle (FCTnameB).

    FCTnameA == roms_fct_a.nc
    FCTnameB == roms_fct_b.nc

! Nesting grids connectivity data: contact points information. This
! NetCDF file is special and complex. It is currently generated using
! the script "matlab/grid/contact.m" from the Matlab repository.

     NGCNAME =  roms_ngc.nc

! Input lateral boundary conditions file names. The USER has the option
! to separate the required lateral boundary variables into individual
! NetCDF files (NBCFILES > 1), as in the input surface forcing.  Also,
! the USER may split input data time records into several NetCDF files
! (monthly, seasonal, or annual). See prologue instructions above. Use
! a single line per entry with a continuation (\) or a vertical bar (|)
! symbol after each entry, except the last one.

    NBCFILES == 1                          ! number of boundary files

     BRYNAME == /home/zeng/roms/Projects/riverplume/data/bdry/HYCOM_GLBy0.08_2023_003_bdry_ZHUSANJIAO.nc

! Input climatology file names. The USER has the option to separate the
! climatology variables into individual NetCDF files (NCLMFILES > 1),
! as in the input surface forcing.  Also, the USER may split input data
! time records into several NetCDF files (monthly, seasonal, or annual).
! See prologue instructions above. Use a single line per entry with a
! continuation (\) or a vertical bar (|) symbol after each entry, except
! the last one.

   NCLMFILES == 1                          ! number of climatology files

     CLMNAME == /home/zeng/roms/Projects/riverplume/data/clm/HYCOM_GLBy0.08_2023_003_clim_ZHUSANJIAO.nc

! Input climatology nudging coefficients file name.

     NUDNAME == roms_nud.nc

! Input Sources/Sinks forcing (like river runoff) file name.

     SSFNAME == /home/zeng/roms/Projects/riverplume/Data/roms_riverplume1_uv.nc

! Input tidal forcing file name.

    TIDENAME == roms_tides.nc

! Input forcing NetCDF file name(s).
!
! The USER has the option to enter several sets of file names for each
! nested grid. For example, the USER may have different data for the
! wind products, heat fluxes, etc. Alternatively, if the all the forcing
! files are the same for nesting and the data is in its native resolution,
! we could enter only one set of files names and ROMS will replicate those
! files internally to the remaining grids using the plural KEYWORD protocol.
!
! The model will scan the files and will read the needed data from the first
! file in the list containing the forcing field. Therefore, the order of the
! filenames is critical. If using multiple forcing files per grid, first
! enter all the file names for grid one followed by two, and so on.  It is
! also possible to split input data time records into several NetCDF files
! (see Prolog instructions above). Use a single line per entry with a
! continuation (\) or a vertical bar (|) symbol after each entry, except
! the last one.

     NFFILES == 11                          ! number of unique forcing files

     FRCNAME == /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_albedo_daily_2023_01.nc \        ! forcing file 1, grid 1
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_cloud_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_lwrad_down_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_Pair_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_Qair_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_rain_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_snow_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_swrad_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_Tair_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_Uwind_3hours_2023_01.nc \
                /home/zeng/roms/Projects/riverplume/data/Forcing/MERRA_Vwind_3hours_2023_01.nc

! Output NetCDF file names, [1:Ngrids].

     DAINAME == roms_dai.nc
     GSTNAME == roms_gst.nc
     RSTNAME == roms_rst.nc
     HISNAME == roms_zhusanjiao_his.nc
     QCKNAME == roms_qck.nc
     TLMNAME == roms_tlm.nc
     TLFNAME == roms_tlf.nc
     ADJNAME == roms_adj.nc
     AVGNAME == roms_zhusanjiao_avg.nc
     HARNAME == roms_har.nc
     DIANAME == roms_dia.nc
     STANAME == roms_sta.nc
     FLTNAME == roms_flt.nc

! Input ASCII parameter filenames.

     APARNAM =  s4dvar.in
     SPOSNAM =  stations.in
     FPOSNAM =  floats.in
     BPARNAM =  bio_Fennel.in
     SPARNAM =  sediment.in
     USRNAME =  MyFile.dat
According studying the official website, I know that the applilcation of Input River(Point Sources) can satisfy my simulation requirements as well(probably?), and I will try to Input River (Point Sources) for my simulation experiments these days. To the honest, don't know the difference between Adding passive tracer and Inputing River (Point Sources).. :cry: :cry:

Altogether, my questions are:
1. What causes the dye concentrations in my calculation result to be 0 and the salt concentration results to be abnormal?
2. In order to be able to simulate the diffusion of liquid substance(dye, sewage or liquid metal salts etc..) in the ocean, should I add passive tracers or input River(Point Sources) or combine the two?
Thank you very much for watching, and any kindly suggestions and guidance from you will bring me great help!! :D :D
Thanks again!

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

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#2 Unread post by wilkin »

You could simplify your test case by choosing Rad instead of RadNud for the dye open boundary condition ... then ROMS should not need use (or even read) the boundary dye values.

You have OBCFAC = 0.0, which I think disables the nudging on inflow. Maybe start with OBCFAC = 1.0 so you have boundary nudging no matter what the flow is doing.

It looks like you've set initial dye values to be large (1e15) in a single cell, at it seems that cell is k=1 which is the bottom, not the surface. So, are you checking for the presence of dye in the right place? Even so, a single cell value will mix away quickly. Also, be careful with i,j indexing: MATLAB is always 1-based while ROMS tracers in FORTRAN count from 0. Is your initial value actually in your land mask?
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Zeng
Posts: 26
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#3 Unread post by Zeng »

wilkin wrote: Wed Mar 15, 2023 9:27 am You could simplify your test case by choosing Rad instead of RadNud for the dye open boundary condition ... then ROMS should not need use (or even read) the boundary dye values.

You have OBCFAC = 0.0, which I think disables the nudging on inflow. Maybe start with OBCFAC = 1.0 so you have boundary nudging no matter what the flow is doing.

It looks like you've set initial dye values to be large (1e15) in a single cell, at it seems that cell is k=1 which is the bottom, not the surface. So, are you checking for the presence of dye in the right place? Even so, a single cell value will mix away quickly. Also, be careful with i,j indexing: MATLAB is always 1-based while ROMS tracers in FORTRAN count from 0. Is your initial value actually in your land mask?
Dear Dr.Wilkin,
Thanks for your prompt reply! According to your guidance, I set OBCFAC to 1, set the initial value to 10000.

Code: Select all

>> a = ncread('HYCOM_GLBy0.08_2023_003_ic_ZHUSANJIAO.nc','dye_01') 
>> a(280,284,15,1) (wet cell)
ans =   10000
As for setting initial value at a land cell, Dorctor, I didn't swtich on River (Point Sources) Input which need to set initial value at coastline cell, just added the passive tracer. When I set initial value at wet cell, I could obtain the dye concentration results from avg.nc file. But when I set initial value at land cell, dye concentration is still 0 everywhere. So I think I may need set the initial value at wet cell(correct?). As shown in the previous picture, the south, east and north sides are open boundary, so I set them to Rad.

Code: Select all

!                   W       S       E       N
!                   e       o       a       o
!                   s       u       s       r
!                   t       t       t       t
!                           h               h
!
!                   1       2       3       4

   LBC(isFsur) ==   Che     Che     Che     Che         ! free-surface
   LBC(isUbar) ==   Shc     Shc     Shc     Shc         ! 2D U-momentum
   LBC(isVbar) ==   Shc     Shc     Shc     Shc         ! 2D V-momentum
   LBC(isUvel) ==   RadNud  RadNud  RadNud  RadNud      ! 3D U-momentum
   LBC(isVvel) ==   RadNud  RadNud  RadNud  RadNud      ! 3D V-momentum
   LBC(isMtke) ==   Clo     Clo     Clo     Clo         ! mixing TKE

   LBC(isTvar) ==   RadNud  RadNud  RadNud  RadNud \    ! temperature
                    RadNud  RadNud  RadNud  RadNud \    ! salinity
                    RadNud  Rad     Rad     Rad         ! dye_01

! Adjoint-based algorithms can have different lateral boundary
! conditions keywords.

ad_LBC(isFsur) ==   Per     Clo     Per     Clo         ! free-surface
ad_LBC(isUbar) ==   Per     Clo     Per     Clo         ! 2D U-momentum
ad_LBC(isVbar) ==   Per     Clo     Per     Clo         ! 2D V-momentum
ad_LBC(isUvel) ==   Per     Clo     Per     Clo         ! 3D U-momentum
ad_LBC(isVvel) ==   Per     Clo     Per     Clo         ! 3D V-momentum
ad_LBC(isMtke) ==   Per     Clo     Per     Clo         ! mixing TKE

ad_LBC(isTvar) ==   Per     Clo     Per     Clo \       ! temperature
                    Per     Clo     Per     Clo \       ! salinity
                    Per     Cla     Cla     Cla         ! dye_01
After some tests, I found that when the initial value is lower than 10000, I can find dye concentrations from avg.nc, when the initial value is higher than 1.e+6, dye concentrations will become 0 everywhere. So I guess, too high initial value caused all the concentration values to be 0?However, a low dye initial concentration(10000) is not very meaningful for my simulations. Because even the surrounding cells, as the model runs, their dye concentration values ​​quickly get very close to 0.
surface dye concentration
surface dye concentration
Maybe I could set initial values for multiple cells, or switching on River (Point Sources) Input is a better solution? Doctor, could you please give me some suggestions?

According to avg.nc results of running 10min, I found that the concentration of water colomn where the cell with initial value is set is aoubt 400.The six columns in the table represent the results of six different operation times。Is there a problem with too average concentration?
dye concentration
dye concentration
Even though I changed the OBAFAC and boundary conditions, the salt concentration still showed an abnormal value of 0.
salt concentration
salt concentration
Thanks for your kindly attention, and look forward your reply!

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

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#4 Unread post by wilkin »

Is that the salt initial condition you want? I doubt it. I think you need to sort out the basic solution before you worry about dyes.

And why all the little lakes in the land?
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Zeng
Posts: 26
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#5 Unread post by Zeng »

wilkin wrote: Fri Mar 17, 2023 11:31 pm Is that the salt initial condition you want? I doubt it. I think you need to sort out the basic solution before you worry about dyes.

And why all the little lakes in the land?
Thank you, doctor. I found the reason why some salt concentrations in avg.nc file are abnormally 0. Because there are some unexpected 0 values of salt concentration in my ini.nc file.
I made the ini.nc file by pyroms, and everything is normal before running the remap_weights.py and make_ic/bdry/clm.py scripts, because before the remapping, there were no unexpected 0 values, and after the remapping, 0 values appeared. Since there are not many parameters in the remap_weights.py and make_ic/bdry/clm.py scripts that I need to set, I am not quite sure what the problem is..

Sorry, doctor, there were some inland lakes in my grid, and they were masked now.

Zeng
Posts: 26
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

#6 Unread post by Zeng »

These are remapping .py scripts.

remap_weights_file.py:

Code: Select all

import matplotlib
matplotlib.use('Agg')
import pyroms
import pyroms_toolbox



# load the grid
srcgrd = pyroms_toolbox.Grid_HYCOM.get_nc_Grid_HYCOM('/home/zeng/soft/pyroms_soft/pyroms/zhuhai_HYCOM/HYCOM_GLBy0.08_ZHUHAI_grid_0.18km.nc')
dstgrd = pyroms.grid.get_ROMS_grid('ZHUHAI')

# make remap grid file for scrip
pyroms_toolbox.Grid_HYCOM.make_remap_grid_file(srcgrd)
pyroms.remapping.make_remap_grid_file(dstgrd, Cpos='rho')
pyroms.remapping.make_remap_grid_file(dstgrd, Cpos='u')
pyroms.remapping.make_remap_grid_file(dstgrd, Cpos='v')

# compute remap weights
# input namelist variables for bilinear remapping at rho points
grid1_file = 'remap_grid_GLBy0.08_NEP_t.nc'
grid2_file = 'remap_grid_ZHUHAI_rho.nc'
interp_file1 = 'remap_weights_GLBy0.08_to_ZHUHAI_bilinear_t_to_rho.nc'
interp_file2 = 'remap_weights_ZHUHAI_to_GLBy0.08_bilinear_rho_to_t.nc'
map1_name = 'GLBy0.08 to ZHUHAI Bilinear Mapping'
map2_name = 'ZHUHAI to GLBy0.08 Bilinear Mapping'
num_maps = 1
map_method = 'bilinear'

# pyroms.remapping.compute_remap_weights(grid1_file, grid2_file, \
#             interp_file1, interp_file2, map1_name, \
#             map2_name, num_maps, map_method)

pyroms.remapping.compute_remap_weights(
         grid1_file=grid1_file, 
         grid2_file=grid2_file, 
         interp_file1=interp_file1, 
         interp_file2=interp_file2, 
         map1_name=map1_name, 
         map2_name=map2_name, 
         num_maps=num_maps, 
         map_method=map_method)
# compute remap weights
# input namelist variables for bilinear remapping at rho points
grid1_file = 'remap_grid_GLBy0.08_NEP_t.nc'
grid2_file = 'remap_grid_ZHUHAI_u.nc'
interp_file1 = 'remap_weights_GLBy0.08_to_ZHUHAI_bilinear_t_to_u.nc'
interp_file2 = 'remap_weights_ZHUHAI_to_GLBy0.08_bilinear_u_to_t.nc'
map1_name = 'GLBy0.08 to ZHUHAI Bilinear Mapping'
map2_name = 'ZHUHAI to GLBy0.08 Bilinear Mapping'
num_maps = 1
map_method = 'bilinear'

pyroms.remapping.compute_remap_weights(grid1_file, grid2_file, \
              interp_file1, interp_file2, map1_name, \
              map2_name, num_maps, map_method)


# compute remap weights
# input namelist variables for bilinear remapping at rho points
grid1_file = 'remap_grid_GLBy0.08_NEP_t.nc'
grid2_file = 'remap_grid_ZHUHAI_v.nc'
interp_file1 = 'remap_weights_GLBy0.08_to_ZHUHAI_bilinear_t_to_v.nc'
interp_file2 = 'remap_weights_ZHUHAI_to_GLBy0.08_bilinear_v_to_t.nc'
map1_name = 'GLBy0.08 to ZHUHAI Bilinear Mapping'
map2_name = 'ZHUHAI to GLBy0.08 Bilinear Mapping'
num_maps = 1
map_method = 'bilinear'

pyroms.remapping.compute_remap_weights(grid1_file, grid2_file, \
              interp_file1, interp_file2, map1_name, \
              map2_name, num_maps, map_method)
make_ic_file.py:

Code: Select all

import subprocess
import os
import subprocess
import numpy as np
#import commands
import matplotlib
matplotlib.use('Agg')

import pyroms
import pyroms_toolbox

from remap import remap
from remap_uv import remap_uv


file = '/home/zeng/soft/pyroms_soft/pyroms/zhuhai_HYCOM/data/HYCOM_GLBy0.08_2023_001.nc'
data_dir = './data/'
dst_dir='./ic/'

print('Build IC file from the following file:')
print(file)
print(' ')

src_grd_file = data_dir + '../HYCOM_GLBy0.08_ZHUHAI_grid_0.18km.nc'
src_grd = pyroms_toolbox.Grid_HYCOM.get_nc_Grid_HYCOM(src_grd_file)
dst_grd = pyroms.grid.get_ROMS_grid('ZHUHAI')

# remap
zeta = remap(file, 'ssh', src_grd, dst_grd, dst_dir=dst_dir)
dst_grd = pyroms.grid.get_ROMS_grid('ZHUHAI', zeta=zeta)
remap(file, 'temp', src_grd, dst_grd, dst_dir=dst_dir)
remap(file, 'salt', src_grd, dst_grd, dst_dir=dst_dir)
remap_uv(file, src_grd, dst_grd, dst_dir=dst_dir)

# merge file
ic_file = dst_dir + file.rsplit('/')[-1][:-3] + '_ic_' + dst_grd.name + '.nc'

out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_ssh_ic_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-O', out_file, ic_file) 
print(command)
subprocess.check_call(command)
os.remove(out_file)
out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_temp_ic_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-A', out_file, ic_file) 
print(command)
subprocess.check_call(command)
os.remove(out_file)
out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_salt_ic_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-A', out_file, ic_file) 
print(command)
subprocess.check_call(command)
os.remove(out_file)
out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_u_ic_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-A', out_file, ic_file) 
print(command)
subprocess.check_call(command)
os.remove(out_file)
out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_v_ic_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-A', out_file, ic_file) 
print(command)
subprocess.check_call(command)
os.remove(out_file)

Post Reply