Custom Query (964 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (7 - 9 of 964)

1 2 3 4 5 6 7 8 9 10 11 12 13
Ticket Resolution Summary Owner Reporter
#959 Done Important: Upated CMEPS NUOPC cap module arango
Description

I implemented the changes made by Ufuk Turunçoğlu to cmeps_roms.F, now called cmeps_roms.h, to avoid interference with the native framework. The native ROMS NUOPC cap module is now called esmf_roms.h. Either NUOPC module is included in esmf_roms.F via CPP. The coupling interface for CDEPS/CMEPS is activated with the CMEPS option, and is intended for connecting to the UFS-coastal framework.

For now, the UFS-coastal repository is downloaded from:

git -c submodule.ADCIRC.update=none clone -b feature/coastal_app --recursive https://github.com/oceanmodeling/ufs-coastal

Notice that we are omitting the ADCIRC component during the cloning since it is still private and working with the research branch feature/coastal_app. This coupling capability is still under development and is complex. Thus, it is not ready for the regular user. We are currently testing the interface to connect ROMS to the UFS coupling framework.

An ESM/build_ufs.sh is provided to facilitate configuring and compiling any ROMS application. It is currently configured for the Hurricane Irene (IRENE) application. See roms_test for more information. It works for the ROMS-DATA coupling system using the CDEFS connectors or the CMEPS mediator. The DATA component is replacing the atmosphere model, and it tests ROMS connection to CDEPS, CMEPS, and UFS coupling driver.


LAPACK/ARPACK Legacy Library:

The ARPACK and its MPI-based parallel (PARPACK) version are well-tested libraries to solve large eigenvalue matrix problems. Our primary use in ROMS is to use its Implicit Restarted Arnoldi Method (IRAM) to solve for the Ritz eigenfunctions in several of our Tangent and Adjoint-based propagators that are part of the Generalized Linear Stability (GLS) package described in Moore et al. (2004) Ocean Modelling paper https://doi.org/10.1016/j.ocemod.2003.11.001. As far as I know, we cannot use a modern replacement library. Therefore, we will continue using that library when running any of the drivers of the GLS package.

However, the ARPACK library includes selected Linear Algebra functions from the BLAS and LAPACK libraries. In particular, we use LAPACK's DSTEQR function to solve for the eigenvalues/eigenvectors of the tri-diagonal system used in the various 4D-Var minimizations available in ROMS.

Thus, I spent some time looking for a replacement. It turns out that any modern software out there is built on top of LAPACK (Phyton, MATLAB, R, SciPy, and others). There are also bindings to C and C++. We could use the eigen, written in C++, but it will be complicated since I will have to write and test the inter-operability mechanism in ROMS for C++ to Fortran 2003 and vice versa (Fortran 2003 to C++). It turns out that the libeigen has BLAS and LAPACK components. See: https://gitlab.com/libeigen/eigen. On top of that, there are reports that the eigen library is much slower than Fortran libraries. Thus, I am giving up on the eigen library. It is beyond our scope.

I decided to adapt the functions we need from LAPACK into module lapack_mod.F, which I converted to Fortran 2003. It includes a total of 19 LAPACK functions. I modernized the code, which had initially 41 GOTOs. I managed to remove 18 of them. The remaining 23 are located in the function DSTEQR. I was able to get identical 4D-Var solutions during testing. That eigenfunction solver is tricky, and removing the remaining GOTOs is dangerous.

The complicated GOTOs are still in selected functions but can be removed from the final C-preprocessing file (lapack_mod.f90) by activating the CPP option REMOVE_LAPACK_GOTOS. For example, in the function DLASRT used to sort the eigenvalues, I have:

#ifdef REMOVE_LAPACK_GOTOS
            DecLOOP_3 : DO                           ! forever LOOP 3
              DecLOOP_1 : DO                         ! forever LOOP 1
                J = J - 1
                IF (D(J) .GE. DMNMX) EXIT DecLOOP_1  ! terminate LOOP 1
              END DO DecLOOP_1
!
              DecLOOP_2 : DO                         ! forever LOOP 2
                I = I + 1
                IF (D(I) .LE. DMNMX) EXIT DecLOOP_2  ! terminate LOOP 2
              END DO DecLOOP_2
!
              IF (I .LT. J) THEN
                TMP = D(I)
                D(I) = D(J)
                D(J) = TMP
                CYCLE DecLOOP_3                      ! iterate LOOP 3
              ELSE
                EXIT DecLOOP_3                       ! terminate LOOP 3
              END IF
            END DO DecLOOP_3
#else
   60       CONTINUE
   70       CONTINUE
            J = J - 1
            IF (D(J) .LT. DMNMX) GO TO 70
   80       CONTINUE
            I = I + 1
            IF (D(I) .GT. DMNMX) GO TO 80
            IF (I .LT. J) THEN
              TMP = D(I)
              D(I) = D(J)
              D(J) = TMP
              GO TO 60
            END IF
#endif

Notice that the above piece of code is slightly complicated. It requires knowledge of the modern Fortran Standard and Objective-Oriented Programming principles to remove the GOTOs, which were unavailable in Fortran and compilers over 40 years ago. This doesn't imply that the LAPACK library is incorrect and produces the wrong results. I am keeping the original code with the GOTOs for reference and testing.

We no longer need the LAPACK/ARPACK libraries to run any 4D-Var drivers in ROMS because the functions that we need are available in our modern adaptation module lapack_mod.F.


Many thanks to Ufuk Turunçoğlu for his hard work and help connecting ROMS to the UFS-coastal.

#958 Done Important: Updated ROMS standalone NUOPC cap for the UFS arango
Description

We continue working on interfacing ROMS to the UFS for coupling. The standard alone NUOPC module cmeps_roms.F was updated to process the needed metadata from a generic input YAML configuration file. The fields to couple are controlled by the import_variables and export_variables tokens.

For example, the roms_cdeps_narr.yaml has:

convention: CF

project: UFS Costal ROMS Coupling

title:   Hurricane Irene Application using CDEPS/CMEPS

date: 2011-08-27T06:00:00Z                   # Starting date, Hurricane Irene

forecast_length: &ForecastLength PT48H       # 48 hours (ISO 8601)
 
coupling_step: &dt 60.0d0                    # 1 minutes (PT180S)

linked_grid:     1                           # linked ROMS nested grid number

ATM_component:   &ATM NCEP
DATA_component:  %DATA NARR
OCN_component:   &OCN ROMS

CoupledSet:      ESM_01
ExportState:     Export_ESM_01
ImportState:     Import_ESM_01

PETlayoutOption: 0

CouplingType:    1                           # explicit

DebugLevel:      2
TraceLevel:      0

standard_input:
  OCN_component: roms_irene.in
  ATM_component: none

import_variables: [dLWrad, SWrad_daily, Pair, Tair, Qair, rain, Uwind, Vwind]

#export_variables: [SSH, Usur, Vsur, SST]

################################
### Exported Fields Metadata ###
################################

export:

  - standard_name:       sea_surface_height_above_geopotential_datum
    long_name:           sea surface height
    short_name:          SSH
    data_variables:      [SSH, time]                            # zeta
    source_units:        meter
    destination_units:   meter
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapnstod
    map_norm:            none

  - standard_name:       surface_eastward_sea_water_velocity
    long_name:           surface eastward momentum component
    short_name:          Usur
    data_variables:      [Usur, time]                           # u
    source_units:        meter second-1
    destination_units:   meter second-1
    source_grid:         left_right_edge
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_northward_sea_water_velocity
    long_name:           surface northward momentum component
    short_name:          Vsur
    data_variables:      [Vsur, time]                           # v
    source_units:        meter second-1
    destination_units:   meter second-1
    source_grid:         lower_upper_edge
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       sea_surface_temperature
    long_name:           sea surface temperature
    short_name:          SST
    data_variables:      [temperature, time]                    # t(:,:,:,itemp)
    source_units:        C
    destination_units:   K
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          273.15d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapnstod
    map_norm:            none

################################
### Imported Fields Metadata ###
################################

import:

  - standard_name:       surface_net_downward_longwave_flux
    long_name:           surface downward longwave radiation flux
    short_name:          dLWrad
    data_variables:      [lwrad_down, time]                     # dlwrfsf minus ulwrfsfc
    source_units:        W m-2
    destination_units:   W m-2
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_net_longwave_flux
    long_name:           surface net longwave radiation flux
    short_name:          LWrad
    data_variables:      [lwrad, time]                          # dlwrfsfc
    source_units:        W m-2
    destination_units:   W m-2
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       net_downward_shortwave_flux_at_sea_water_surface
    long_name:           surface net shortwave radiation flux
    short_name:          SWrad
    data_variables:      [swrad_daily, time]                    # dlwrfsfc
    source_units:        W m-2
    destination_units:   W m-2
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       net_averaged_shortwave_flux_at_sea_water_surface
    long_name:           surface net averaged shortwave radiation flux
    short_name:          SWrad_daily
    data_variables:      [swrad_daily, time]                    # dswrfsfc minus uswrfsfc
    source_units:        W m-2
    destination_units:   W m-2
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_air_pressure
    long_name:           surface air pressure
    short_name:          Pair
    data_variables:      [Pair, time]
    source_units:        mb
    destination_units:   mb
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_air_temperature
    long_name:           surface (2m) air temperature
    short_name:          Tair
    data_variables:      [Tair, time]
    source_units:        C
    destination_units:   C
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_relative_humidity
    long_name:           surface relative humidity
    short_name:          Qair
    data_variables:      [Qair, time]
    source_units:        percent
    destination_units:   fraction
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               0.01d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       precipitation_flux
    long_name:           precipitation rate
    short_name:          rain
    data_variables:      [rain, time]
    source_units:        kg m-2 s-1
    destination_units:   kg m-2 s-1
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_eastward_wind
    long_name:           surface eastward wind at 10m
    short_name:          Uwind
    data_variables:      [Uwind, time]
    source_units:        m s-1
    destination_units:   m s-1
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_northward_wind
    long_name:           surface northward wind at 10m
    short_name:          Vwind
    data_variables:      [Vwind, time]
    source_units:        m s-1
    destination_units:   m s-1
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *DATA
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_downward_heat_flux_in_sea_water
    long_name:           surface net heat flux
    short_name:          shflux
    data_variables:      [shflux, time]
    source_units:        W m-2
    destination_units:   Celsius m s-1
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_upward_water_flux
    long_name:           surface freshwater flux (E-P)
    short_name:          swflux
    data_variables:      [swflux, time]
    source_units:        kg m-2 s-1
    destination_units:   kg m-2 s-1
    source_grid:         cell_center
    destination_grid:    cell_center
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_downward_x_stress
    long_name:           surface eastward wind stress
    short_name:          sustr
    data_variables:      [sustr, time]
    source_units:        N m-2
    destination_units:   m-2 s-2
    source_grid:         cell_center
    destination_grid:    left_right_edge
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

  - standard_name:       surface_downward_y_stress
    long_name:           surface northward wind stress
    short_name:          svstr
    data_variables:      [svstr, time]
    source_units:        N m-2
    destination_units:   m-2 s-2
    source_grid:         cell_center
    destination_grid:    lower_upper_edge
    add_offset:          0.0d0
    scale:               1.0d0
    debug_write:         false
    connected_to:        *ATM
    map_type:            mapbilnr
    map_norm:            none

It only uses the metadata for the variables specified in:

import_variables: [dLWrad, SWrad_daily, Pair, Tair, Qair, rain, Uwind, Vwind]
#export_variables: [SSH, Usur, Vsur, SST]

Since we are testing the coupling to the DATA component using CDEPS, the export_variables token is commented out. Only the metadata for the variables specified in import_variables will be processed; the other metadata is ignored. There is no need to add or remove field metadata. It has everything it needs for coupling ROMS in various configurations.

The cmeps_roms.F NUOPC module was updated accordingly.

This work is done in collaboration with Ufuk Turunçoğlu (NCAR/NOAA).

#957 Done Changed ROMS License arango
Description

The License_ROMS.txt was renamed to License_ROMS.md to allow Markdown documentation.

# Copyright (c) 2002-2023 The ROMS/TOMS Group
#   Licensed under a MIT/X style license
#   See License_ROMS.md
1 2 3 4 5 6 7 8 9 10 11 12 13
Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.