Changeset 2718


Ignore:
Timestamp:
2011-04-04T12:03:24+02:00 (10 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
Location:
trunk/NEMOGCM/TOOLS/WEIGHTS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/TOOLS/WEIGHTS/README

    r2448 r2718  
    4848                         ./ 
    4949                          | 
    50      +-------------+--------------+ 
    51   SCRIP1.4      nocsutil         bin 
     50     +-------------+--------------+--------------+ 
     51  SCRIP1.4      nocsutil         src            bin 
    5252 
    5353SCRIP1.4 contains the unmodified copy (apart from compression of two sample netcdf 
     
    5656 
    5757The bin directory contains python script freeform.py. 
    58 This is run to reformat the code for use within the NEMO 3.3 FCm framework. 
     58This is run to reformat the code for use within the NEMO 3.3 fcm framework. 
    5959It creates and populates a directory called 'src' with copied and modified versions 
    60 of the SCRIP library routines.  Changes are described in the src/CHANGES file. 
     60of the SCRIP library routines (and derived programs from the nocsutil directory).   
     61Changes are described in the src/CHANGES file. 
    6162This script has already been run and only needs to be re-executed if SCRIP is updated. 
    6263 
    63 The nocscrip directory contains the code for the three programs used to  
    64 generate a weights file. These are: 
     64The src directory also contains the three programs used to generate a weights file. 
     65The three programs are: 
    6566 
    6667scripgrid.exe (scripgrid.F90) which creates two grid description files suitable for 
     
    8889example namelists provided are located in its refout subdirectory. 
    8990 
    90 Installation is by use of the makenemo script. 
     91Installation is by use of the maketools script. 
     92E.g. change to the NEMOGCM/TOOLS directory and type: 
     93 
     94./maketools -help 
     95 
     96and, for example: 
     97 
     98./maketools -m gfortran_linux -n WEIGHTS 
     99 
    91100 
    92101Example Use 
     
    173182the grid centre and corner locations required by scrip. In the example given, 
    174183a file called 'coordinates.nc' must exist in the current directory. This is 
    175 recognised by scripgrid as a nemo coordinates file and the correct corner 
     184used by scripgrid as a nemo coordinates file and the correct corner 
    176185locations appropriate to the named grid centres are obtained (i.e. since 
    177186glamt is named, glamf and gphif will be used to provide corner coordinates). 
     187The nemo file need not be called 'coordinates.nc' (e.g. '1_coordinates.nc' instead), 
     188but must have longitude and latitude variables which start with the four  
     189characters 'gphi' and 'glam' respectively. 
    178190"input_file" file must contain at least one variable on a grid whose axes are 
    179191described by the netcdf coordinate variables named in input_lon and input_lat. 
  • 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" 
  • trunk/NEMOGCM/TOOLS/WEIGHTS/nocsutil/scripinterp.F90

    r2352 r2718  
    1919  write(6,*) 'enter the name of an input namelist' 
    2020  read(5,*) nm_in 
     21  call process_grid(nm_in) 
    2122#endif 
    2223 
  • trunk/NEMOGCM/TOOLS/WEIGHTS/src/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" 
  • trunk/NEMOGCM/TOOLS/WEIGHTS/src/scripinterp.F90

    r2352 r2718  
    1919  write(6,*) 'enter the name of an input namelist' 
    2020  read(5,*) nm_in 
     21  call process_grid(nm_in) 
    2122#endif 
    2223 
Note: See TracChangeset for help on using the changeset viewer.