schism-dev / schism

Semi-implicit Cross-scale Hydroscience Integrated System Model (SCHISM)
http://ccrm.vims.edu/schismweb/
Apache License 2.0
87 stars 86 forks source link

FABM/SCHISM: UNFULFILLED DEPENDENCY: downwelling_photosynthetic_radiative_flux #134

Open jpein1 opened 5 months ago

jpein1 commented 5 months ago

Although compiling, by SCHISM-FABM-ECOSMO simulation crashes writing this statement at the and of mirror.out:

FABM/SCHISM: UNFULFILLED DEPENDENCY: downwelling_photosynthetic_radiative_flux FABM/SCHISM: This is an interior field. FABM/SCHISM: It has units W m-2 FABM/SCHISM: It is needed by the following model instances:

In fabm_schism.F90 it seems for API >= 1 call fs%model%link_horizontal_data(fabm_standard_variables%surface_downwelling_photosynthetic_radiative_flux,fs%par0) intializes the SURFACE downwelling but not the interior light field. Is the latter missing?

platipodium commented 5 months ago

The interior light field is not calculated by the host. You need to couple to a model that provides this light field, such as gotm/light.

instances:
  npzd:
    model: gotm/npzd
    parameters:
      p0: 0.0225           # background phytoplankton concentration (mmol m-3), default = 0.0225
      z0: 0.0225           # background zooplankton concentration (mmol m-3), default = 0.0225
      kc: 0.03             # specific light extinction of phytoplankton and detritus (m2 mmol-1), default = 0.03
      i_min: 25.0          # minimum light intensity in euphotic zone (W m-2), default = 25.0
      rmax: 1.0            # maximum specific growth rate of phytoplankton (d-1), default = 1.0
      gmax: 0.2            # maximum specific grazing rate of zooplankton (d-1), default = 0.5
      iv: 1.1              # Ivlev grazing constant (m3 mmol-1), default = 1.1
      alpha: 1.35          # half-saturation nutrient concentration for phytoplankton (mmol m-3), default = 0.3
      rpn: 0.01            # loss rate of phytoplankton to nutrients (d-1), default = 0.01
      rzn: 0.01            # loss rate of zooplankton to nutrients (d-1), default = 0.01
      rdn: 0.003           # detritus remineralization rate (d-1), default = 0.003
      rpdu: 0.02           # phytoplankton mortality in euphotic zone (d-1), default = 0.02
      rpdl: 0.1            # phytoplankton mortality below euphotic zone (d-1), default = 0.1
      rzd: 0.02            # zooplankton mortality (d-1), default = 0.02
      w_p: -1.0            # vertical velocity of phytoplankton (<0 for sinking) (m d-1), default = -1.0
      w_d: -5.0            # vertical velocity of detritus  (<0 for sinking) (m d-1), default = -5.0
    initialization:
      nut: 4.5             # nutrients (mmol m-3)
      phy: 1e-15           # phytoplankton (mmol m-3)
      zoo: 1e-15           # zooplankton (mmol m-3)
      det: 4.5             # detritus (mmol m-3)
  light:
    model: gotm/light

We test this regularly with npzd, but not with ecosmo, so the dependency might be different. If it is, this needs to be implemented in the host. Unfortunately, the light field calculation changed a lot between FABM0 and FABM1 ...

jpein1 commented 5 months ago

Thanks, got it. Can I use gotm just for light or do I need to use it for turbulence modelling too in this case?

platipodium commented 5 months ago

Thanks, got it. Can I use gotm just for light or do I need to use it for turbulence modelling too in this case?

This is just the light model in the gotm "institute" folder, has nothing to do with GOTM turbulence, so you don't need GOTM.

Can you please test and report success/failure with ecosmo, then close ticket if resolved?

platipodium commented 5 months ago

And of course, we could make a light field model internally available in the host. Someone would need to code it (for FABM1) ....

jpein1 commented 5 months ago

That was exactly the point. Invoking

light: model: gotm/light parameters: g2 : 23.0 # e-folding depth of visible fraction (m) default=23.0 g1 : 0.35 A : 0.58

in the fabm.yaml solved the issue.

This worked keeping itur=3 in param.nml of SCHISM.

platipodium commented 5 months ago

Do you @jpein1 think it is necessary to implement a light routine in the host itself?