fabm_configure Subroutine

public subroutine fabm_configure(dt, yaml_file)

read fabm.yaml and call FABM configuration subroutines

Note

seems tmask is not initialised until called in mom() - i.e. after initialization - so all values are 0 here

Arguments

Type IntentOptional Attributes Name
real(kind=rke), intent(in) :: dt

bio-geochemical time step as set by MOM2 [s]

character(len=*), intent(in), optional :: yaml_file

name of alternativ FABM configuration file


Calls

proc~~fabm_configure~~CallsGraph proc~fabm_configure uvic_fabm::fabm_configure fabm_create_model fabm_create_model proc~fabm_configure->fabm_create_model set_bottom_index set_bottom_index proc~fabm_configure->set_bottom_index set_domain set_domain proc~fabm_configure->set_domain set_domain_start set_domain_start proc~fabm_configure->set_domain_start set_domain_stop set_domain_stop proc~fabm_configure->set_domain_stop set_mask set_mask proc~fabm_configure->set_mask tmask tmask proc~fabm_configure->tmask

Source Code

      subroutine fabm_configure(dt,yaml_file)
        !! read fabm.yaml and call FABM configuration subroutines

      real(rke), intent(in) :: dt
        !! bio-geochemical time step as set by MOM2 [s]
      character(len=*), intent(in), optional :: yaml_file
        !! name of alternativ FABM configuration file

        integer :: n

         print*, '==> Initializing FABM with (nt, nsrc, numbsc) =',
     &                                        nt, nsrc, numsbc

         if (present(yaml_file)) then
            model => fabm_create_model(trim(yaml_file))
         else
            model => fabm_create_model('fabm.yaml')
         end if

         nsurface = size(model%surface_state_variables)
         npelagic = size(model%interior_state_variables)
         nbottom = size(model%bottom_state_variables)

         if (nfabm .ne. npelagic) then
            print*, 'nt (UVic)     = ',nt
            print*, 'nsrc (UVic)   = ',nsrc
            print*, 'numsbc (UVic) = ',numsbc
            print*, 'nsurface      = ',nsurface
            print*, 'npelagic      = ',npelagic
            print*, 'nbottom       = ',nbottom
            stop 'fabm_configure()'
         end if

#ifdef DEBUG
         print*, imt,jmt,jmw
         !print*, jrow,js,je,is,ie
         print*, 'zt: ',shape(zt)
         print*, 't: ',shape(t)
         print*, 'sbc: ',shape(sbc)
         print*, 'src: ',shape(src) ! imt,km,jsmw:jemw,nsrc
         print*, 'source: ',shape(source) ! imt,km,jsmw:jemw
         print*, 'rho: ',shape(rho)
         !stop 112
#endif   
         call model%set_domain(imt,km,jmt,dt)
         call model%set_domain_start(2,1,2)
         call model%set_domain_stop(imt-1,km,jmt-1)
         call model%set_mask(tmask,tmask(:,1,:))
         call model%set_bottom_index(kmt)

         !! @note
         !! seems tmask is not initialised until called in mom() - 
         !! i.e. after initialization - so all values are 0 here
         !! @endnote
      end subroutine fabm_configure