New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2718 for trunk/NEMOGCM/TOOLS/WEIGHTS/nocsutil/scripgrid_mod.F90 – NEMO

Ignore:
Timestamp:
2011-04-04T12:03:24+02:00 (13 years ago)
Author:
sga
Message:

NEMO trunk: small corrections to the weights generation code in the TOOLS directory for nemo 3.3

  • typos in README file corrected
  • scripgrid.F90 now allows any input nemo grid filename (but lat/lon names have to begin with glam/gphi)
  • scripinterp.F90 now actually does something
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/TOOLS/WEIGHTS/nocsutil/scripgrid_mod.F90

    r2352 r2718  
    9292    call release_unit(iunit) 
    9393 
    94     if (trim(nemo_file) .eq. 'coordinates.nc') then 
    95  
    96       ! set up the names of the corner variables for a given input 
    97       ! the offset represents what needs to be added to (i,j) to get to the correct  
    98       ! element in the corner arrays to correspond to the point northeast of the center 
    99       if (nemo_lon(5:5) == "t") then 
    100         corn_lon = "glamf" 
    101         corn_lat = "gphif" 
    102         offset = (/ 0,0 /) 
    103       else if (nemo_lon(5:5) == "u") then 
    104         corn_lon = "glamv" 
    105         corn_lat = "gphiv" 
    106         offset = (/ 1,0 /) 
    107       else if (nemo_lon(5:5) == "v") then 
    108         corn_lon = "glamu" 
    109         corn_lat = "gphiu" 
    110         offset = (/ 0,1 /) 
    111       else 
    112         write(6,*) 'unknown nemo_lon name' 
    113         stop 
    114       endif 
    115  
    116       write(6,*) "processing " // trim(nemo_file) 
    117       call convertNEMO(nemo_file, nemo_lon, nemo_lat, corn_lon, corn_lat, & 
    118                        offset, nemogrid_file) 
    119  
     94    if (nemo_lon(1:4) .ne. 'glam' .or. nemo_lat(1:4) .ne. 'gphi') then 
     95      write(6,*) 'lon name does not start with "glam" or lat name does not start with "gphi"' 
     96      stop 
     97    endif 
     98 
     99    ! set up the names of the corner variables for a given input 
     100    ! the offset represents what needs to be added to (i,j) to get to the correct  
     101    ! element in the corner arrays to correspond to the point northeast of the center 
     102    if (nemo_lon(5:5) == "t") then 
     103      corn_lon = "glamf" 
     104      corn_lat = "gphif" 
     105      offset = (/ 0,0 /) 
     106    else if (nemo_lon(5:5) == "u") then 
     107      corn_lon = "glamv" 
     108      corn_lat = "gphiv" 
     109      offset = (/ 1,0 /) 
     110    else if (nemo_lon(5:5) == "v") then 
     111      corn_lon = "glamu" 
     112      corn_lat = "gphiu" 
     113      offset = (/ 0,1 /) 
    120114    else 
    121  
    122       write(6,*) "processing regular grid " // trim(nemo_file) 
    123       call convertFLUX(nemo_file, nemo_lon, nemo_lat, & 
    124                        nemo_mask, nemo_mask_value, nemogrid_file) 
    125  
     115      write(6,*) 'unknown nemo_lon name' 
     116      stop 
    126117    endif 
     118 
     119    write(6,*) "processing " // trim(nemo_file) 
     120    call convertNEMO(nemo_file, nemo_lon, nemo_lat, corn_lon, corn_lat, & 
     121                     offset, nemogrid_file) 
    127122 
    128123    write(6,*) "processing regular grid" 
Note: See TracChangeset for help on using the changeset viewer.