Custom Query (964 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (610 - 612 of 964)

Ticket Owner Reporter Resolution Summary
#737 arango Done Important: Improved ROMS Error Handling
Description

This update changed several files to improve the error handling in ROMS.

  • The check error statements:
         IF (exit_flag.ne.NoError) RETURN 
    
         IF (status.ne.nf90_noerr) THEN
           ...
         END IF
    
    were changed to:
         IF (FoundError(exit_flag, NoError, __LINE__,                &
        &               __FILE__)) RETURN
    
         IF (FoundError(status, nf90_noerr, __LINE__,                &
        &               __FILE__)) THEN
           ...
         END IF
    
    The logical function FoundError was added to the string_mod module (ROMS/Utility/string.F):
         USE strings_mod, ONLY : FoundError
    
    
  • The function FindError prints the line and source code where the error occurred, if any:
          FUNCTION FoundError (flag, NoErr, line, routine) RESULT (foundit)
    !
    !=======================================================================
    !                                                                      !
    !  This logical function checks ROMS execution flag against no-error   !
    !  code and issue a message if they are not equal.                     !
    !                                                                      !
    !  On Input:                                                           !
    !                                                                      !
    !     flag         ROMS execution flag (integer)                       !
    !     NoErr        No Error code (integer)                             !
    !     line         Calling model routine line (integer)                !
    !     routine      Calling model routine (string)                      !
    !                                                                      !
    !  On Output:                                                          !
    !                                                                      !
    !     foundit      The value of the result is TRUE/FALSE if the        !
    !                    execution flag is in error.                       !
    !                                                                      !
    !=======================================================================
    !
          USE mod_iounits,  ONLY : stdout
          USE mod_parallel, ONLY : Master
    
    !  Imported variable declarations.
    !
          integer, intent(in) :: flag, NoErr, line
    
          character (len=*), intent(in) :: routine
    !
    !  Local variable declarations.
    !
          logical :: foundit
          character (len=5) :: lstr
    !
    !-----------------------------------------------------------------------
    !  Scan array for requested string.
    !-----------------------------------------------------------------------
    !
          foundit=.FALSE.
          IF (flag.ne.NoErr) THEN
            foundit=.TRUE.
            IF (Master) THEN
              WRITE (lstr,'(i5)') line
              WRITE (stdout,10) flag, ADJUSTL(TRIM(lstr)), TRIM(routine)
      10      FORMAT (' Found Error: ', i2.2, t20, 'Line: ', a,             &
         &            t35, 'Source: ', a)
            END IF
          END IF
    
          RETURN
          END FUNCTION FoundError
    
  • I used a Perl script to make this substitution in the entire code. We get more information for error, for example:
    NETCDF_PUT_FVAR_1D - error while writing variable:  tide_period
                         in input file:  r10/doppio_har.nc
                         call from:  ROMS/Utility/wrt_tides.F
    
     Found Error: 03   Line: 93       Source: ROMS/Utility/wrt_tides.F
    
     ERROR: Abnormal termination: NetCDF OUTPUT.
     REASON: NetCDF: Variable not found
    
    Notice that the line number is in the original *.F code instead of the compiled file *.f90 because we are using the __LINE__ and __FILE__ C-preprocessing macros that operate in the original source code.
#738 arango Done Important: ESMF/NUOPC coupling, phase I
Description

Introduction

I have been working for few month on completely rewriting the multi-model coupling using the ESMF (Earth System Modeling Framework) library with the NUOPC (National Unified Operational Prediction Capability) layer. The NUOPC Layer is a simplified infrastructure on top of the ESMF library (version 7 or higher) that provides conventions and templates to facilitate the smooth coupling between Earth System Models (ESMs).

The ESMF/NUOPC coupling algorithms in ROMS allow both driver and component modes of operation. In the driver mode, ROMS provides all the interfaces needed to couple to other ESM components including the main driver, NUOPC-based generic ESM component services, model gridded components or NUOPC Model cap files, connectors between components for re-gridding source and destination fields, and input scripts and coupling metadata management. The NUOPC Model cap is a Fortran module layer that sits on top of the ESM component, making calls into it (initialize, run, and finalize phases). Alternatively, in the component mode, the NUOPC ROMS cap module is provided which can be adapted and incorporated into other NUOPC-based coupling systems.

https://www.myroms.org/trac/coupling_diagram.png

The current design of the ROMS native driver mode includes seven ESM components: (i) Ocean Model, (ii) Atmosphere Model, (iii) Sea Ice model, (iv) Wave Model, (v) Ocean Boundary Model (vi) Estuary Model, and (vii) Data Model. Currently, the following cap files are in various staged of development:

  • Ocean Model: ROMS
  • Atmosphere Models: COAMPS, RegCM, WRF
  • Sea Ice Model: CICE
  • Waves Models: SWAN, WAM, WaveWatch III
  • Ocean Boundary Model: To be determined
  • Estuary Model: ADCIRC, or other storn surge models

The Data Model is used to provide coupling data to the atmospheric model at locations not covered by the other ESM components because of smaller grid coverage. For example, if the atmosphere and ocean model grids do not have the same area coverage, the atmosphere model still needs to import sea surface temperature (SST) on those grid points not covered by the ocean model. In the future, CICE will need a data connection for when just coupled to ROMS.

Phase I

In Phase I, several minor changes are done to ROMS to facilitate synchronization between all the svn branches:

  • The C-preprocessing options AIR_OCEAN and WAVES_OCEAN are renamed to ATM_COUPLING and WAV_COUPLING, respectively.
  • Several new C-preprocessing options are introduced for coupling to various ESM components: CICE_COUPLING, COAMPS_COUPLING, REGCM_COUPLING, SWAN_COUPLING, WAM_COUPLING, and more to come.
  • The following files are renamed:
    svn mv Master/mct_coupler.h Master/mct_driver.h
    svn mv Master/ocean_coupler.F Master/mct_coupler.h
    svn mv Master/esmf_coupler.h Master/esmf_coupler.h
    svn mv ROMS/External/coupling.dat ROMS/External/coupling_mct.dat
    svn mv ROMS/Utility/inquire.F ROMS/Utility/inquiry.F
    
    The first two needs to be done in that particular order. We cannot use the inquire subroutine name because it is an intrinsic Fortran function. I missed that one.
  • The COUPLING_INTERP option is added to allow time interpolation between coupling fields to the case that the time exchange window is long. The two-snapshots arrays are used to store the imported data. As consequence, very tricky CPP logic in needed in set_data.F. Please do not change that logic. It 's hard to figure it out.
  • All the compilation configuration files (Compilers/*.mk) were updated to include the newer ESMF compiling logic.
  • Warning: the globaldefs.h was modified to include new CPP options for coupling.

I am not ready to release the full coupling algorithms. There are still developments ahead and testing.

#739 arango Done Updated the Red Tide model
Description

The red tide model (RED_TIDE) was updated to include a Q10 mortality rate equation, as a function of temperature. It includes new input parameters in red_tide.in:

! Mortality rate Q10 equation parameters, as a function of temperature:
!
!   M_rate = Mor_a * Mor_Q10^[(temperature-MOR_To)/10] + Mor_b

         MOR_a == 0.04d0                         ! amplitude, 1/day

         MOR_b == 0.03d0                         ! intercept, 1/day

       MOR_Q10 == 10.0d0                         ! reaction rate base

        MOR_T0 == 15.0d0                         ! background temperature (C)

A couple of input parameters are also adjusted in red_tide.in for the Gulf of Maine:

! Maximum growth rate at optimal temperature and salinity [1/day]

          Gmax == 1.05d0                        ! Gmax

! Germination depth [cm]

            Dg == 0.18d0                         ! Dg

The BIO_TOY example gives the following Alexandrium Fundyense concentration:

https://www.myroms.org/trac/redtide_dinoflagellate.png

Notice that I am plotting the LOG of the concentration.

Many thanks to Yizhen Li for the testing and update of the Red Tide Model.

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.