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 7148 – NEMO

Changeset 7148


Ignore:
Timestamp:
2016-10-27T17:37:22+02:00 (8 years ago)
Author:
acc
Message:

Branch dev_r6393_NOC_WAD. Tweaks to script for using unsupported configurations on systems without wget access to the internet

Location:
branches/2016/dev_r6393_NOC_WAD/NEMOGCM/TOOLS/MISCELLANEOUS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6393_NOC_WAD/NEMOGCM/TOOLS/MISCELLANEOUS/README_uspcfg

    r7117 r7148  
    2222local copies reflect any changes made in the remote sources. 
    2323 
    24 The proceedure requires the following steps: 
     24The procedure requires the following steps: 
    2525 
    26261. From the target NEMOGCM directory on your target system copy the following 
     
    5353 
    5454   ls -1R ISOMIP_ARCHIVE 
    55    cpp_ISOMIP.fcm           - downloaded from remote server 
    56    def_wget                 - newly constructed script 
    57    local.ctl                - file list modified for local copy 
    58    uspcfg_local.txt         - a copy of uspcfg.txt with modification for local copy 
    59    remote_file.list         - downloaded from remote server 
    60    set_local_uspcfg         - newly constructed script 
    61    EXP00                    - new subdirectory 
    62    MY_SRC                   - new subdirectory 
     55   cpp_ISOMIP.fcm             - downloaded from remote server 
     56   def_wget                   - newly constructed script 
     57   local_template.ctl         - file list modified for local copy 
     58   uspcfg_local_template.txt  - a copy of uspcfg.txt with modification for local copy 
     59   remote_file.list           - downloaded from remote server 
     60   set_local_uspcfg           - newly constructed script 
     61   EXP00                      - new subdirectory 
     62   MY_SRC                     - new subdirectory 
    6363 
    6464   ./EXP00: 
    65    iodef.xml                - downloaded from remote server 
    66    namelist_cfg             - downloaded from remote server 
     65   iodef.xml                  - downloaded from remote server 
     66   namelist_cfg               - downloaded from remote server 
    6767 
    6868   ./MY_SRC: 
    69    domzgr.F90               - downloaded from remote server 
    70    istate.F90               - downloaded from remote server 
     69   domzgr.F90                 - downloaded from remote server 
     70   istate.F90                 - downloaded from remote server 
    7171 
    72724. The final stage is to enter the directory and execute the set_local_uspcfg script. 
    7373   This script will prompt for a full path to the target CONFIG directory and then: 
    7474 
    75    a. Edit the local.ctl and uspcfg_local.txt files to insert the full path 
    76       to the archive directory (i.e. the current working directory) 
     75   a. Edit the templates and create local.ctl and uspcfg_local.txt files by inserting  
     76      the full path to the archive directory (i.e. the current working directory) 
    7777   b. move uspcfg_local.txt to the named CONFIG directory 
    7878   c. rename any existing uspcfg.txt file in the CONFIG directory to uspcfg_remote.txt 
    7979   d. insert symbolic link (uspcfg.txt) to uspcfg_local.txt in the CONFIG directory 
    80    e. redefine/define wget as a bash function to simply copy 
     80   e. redefine/define wget as an exported bash function to simply copy 
    8181 
    8282   This last action is needed so that subsequent use of makenemo with the -u argument 
     
    9292   . ./def_wget 
    9393 
     94   [ Tip: check that the definition/re-definition of wget has worked correctly by 
     95     issuing this command: 
     96 
     97     wget a b c 
     98 
     99     If you get messages such as: 
     100 
     101       wget a b c 
     102       --2016-10-27 10:14:52--  http://a/ 
     103       Resolving a... failed: Name or service not known. 
     104       wget: unable to resolve host address `a' 
     105       . 
     106       . 
     107 
     108     then the re-definition of wget has not been retained by the current shell. Run 
     109     . ./def_wget and try again. You should get a response such as: 
     110 
     111     wget a b c 
     112     Expected wget usage: wget src -O dest 
     113     -O not found. No action taken 
     114 
     115     if the environment is set correctly 
     116   ] 
     117 
    941185. The setup is now complete and moving to the CONFIG directory and issuing a command 
    95119   such as: 
    96120 
    97    ./makenemo -n MYISOMIP -u ISOMIP -m target_arch 
     121    ./makenemo -n MYISOMIP -u ISOMIP -m target_arch 
    98122 
    99123   should correctly configure from local archives only.    
    100124 
     125   [ Tip: the -u argument ( and hence the need to switch wget to local copies on isolated 
     126     systems ) is only required when compiling for the first time. Subsequent compilations 
     127     following code changes in the MYISOMIP directories can be carried out in your 
     128     default nemo environment. I.e.: 
     129 
     130     ./makenemo -n MYISOMIP -m target_arch 
     131 
     132     will not require any of the preceeding steps in future sessions. 
     133   ] 
     134 
  • branches/2016/dev_r6393_NOC_WAD/NEMOGCM/TOOLS/MISCELLANEOUS/make_usp_tar.sh

    r7117 r7148  
    116116       if [ $remfile == 'create_directory' ] ;then 
    117117         mkdir $locfile 
    118          echo $remfile "                 " $locfile >> local.ctl 
     118         echo $remfile "                 " $locfile >> local_template.ctl 
    119119       else 
    120120         wget $remfile -O $locfile 
    121121         remfile=$(echo $remfile | sed -e "s;.*$locfile;SET_LOCAL_DIRECTORY_HERE/$locfile;") 
    122          echo $remfile "  " $locfile >> local.ctl 
     122         echo $remfile "  " $locfile >> local_template.ctl 
    123123       fi 
    124124      done 
     
    134134#---------------------------------------------------------------- 
    135135# 
    136    grep -v "$2 " $1 >  uspcfg_local.txt 
     136   grep -v "$2 " $1 >  uspcfg_local_template.txt 
    137137# 
    138138#---------------------------------------------------------------- 
     
    140140#---------------------------------------------------------------- 
    141141# 
    142    cat cfg.tmp | sed -e "s;http.*$;SET_LOCAL_DIRECTORY_HERE/local.ctl;" >> uspcfg_local.txt 
     142   cat cfg.tmp | sed -e "s;http.*$;SET_LOCAL_DIRECTORY_HERE/local.ctl;" >> uspcfg_local_template.txt 
    143143# 
    144144# 
     
    161161# Edit the local.ctl file to set the local directory path 
    162162# 
    163    ed - local.ctl << EOFA 
    164 g/SET_LOCAL_DIRECTORY_HERE/s;SET_LOCAL_DIRECTORY_HERE;\$basedir; 
    165 w 
    166 q 
    167 EOFA 
     163   sed -e "s;SET_LOCAL_DIRECTORY_HERE;\$basedir;" local_template.ctl > local.ctl 
    168164# 
    169165# Edit the uspcfg_local.txt file to set the local directory path 
    170166# 
    171    ed - uspcfg_local.txt << EOFB 
    172 /SET_LOCAL_DIRECTORY_HERE/s;SET_LOCAL_DIRECTORY_HERE;\$basedir; 
    173 w 
    174 q 
    175 EOFB 
     167   sed -e "s;SET_LOCAL_DIRECTORY_HERE;\$basedir;" uspcfg_local_template.txt > uspcfg_local.txt 
     168# 
     169# Install local versions in the named CONFIG directory 
     170# 
    176171   if [ -f \$confdir/uspcfg.txt ] && [ ! -L \$confdir/uspcfg.txt ]; then 
    177172    mv \$confdir/uspcfg.txt \$confdir/uspcfg_remote.txt 
     
    196191   fi 
    197192} 
     193export -f wget 
    198194EOF 
    199195#---------------------------------------------------------------- 
     
    217213   fi 
    218214} 
     215export -f wget 
    219216EOFC 
    220217#---------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.