1 | Instructions for using unsupported configurations on systems without wget access to |
---|
2 | the internet |
---|
3 | |
---|
4 | The unsupported configurations in NEMO are provided as a way for users to provide |
---|
5 | alternative configurations to the wider community without having to rely on system team |
---|
6 | sponsership and support. The idea is to provide minimal but sufficient information |
---|
7 | with the standard distribution to allow ancillary files to be fetched from remote |
---|
8 | servers at compile time. Thus a makenemo command such as: |
---|
9 | |
---|
10 | ./makenemo -n MYISOMIP -u ISOMIP -m some_arch |
---|
11 | |
---|
12 | will create a new configuration called MYISOMIP with MY_SRC and EXP00 directories |
---|
13 | populated from a remote server. It does this by first using the wget command to fetch a |
---|
14 | list of remote files and then using wget repeatedly to fetch each of the files listed |
---|
15 | therein. The location of the remote list is contained in one line of information held |
---|
16 | in the uspcfg.txt file (in CONFIG). |
---|
17 | |
---|
18 | These instructions provide a work-around for systems without direct access to the |
---|
19 | internet or on which wget has been disabled/not installed. On these systems it is |
---|
20 | possible to create local copies of the remote files and replace the wget function |
---|
21 | with a local copy command. It will be the user's responsibility to ensure that the |
---|
22 | local copies reflect any changes made in the remote sources. |
---|
23 | |
---|
24 | The procedure requires the following steps: |
---|
25 | |
---|
26 | 1. From the target NEMOGCM directory on your target system copy the following |
---|
27 | files into a working directory on a system that does have internet access |
---|
28 | and a working wget command: |
---|
29 | |
---|
30 | a. TOOLS/MISCELLANEOUS/make_usp_tar.sh |
---|
31 | b. CONFIG/uspcfg.txt |
---|
32 | |
---|
33 | 2. On that alternative system and in the working directory containing the newly |
---|
34 | copied files, run the make_usp_tar.sh script. The script takes three arguments: |
---|
35 | |
---|
36 | a. The name of the uspcfg.txt file |
---|
37 | b. The name of the unsupported configuration you wish to use |
---|
38 | c. The name of a directory that will be created and filled with the remote |
---|
39 | files in the current working directory. This directory will be tarred and |
---|
40 | eventually transferred to the target system. There it will be unpacked and |
---|
41 | will form the local archive for this configuration. A meaningful name is |
---|
42 | therefore recommended. |
---|
43 | |
---|
44 | For example: |
---|
45 | |
---|
46 | ./make_usp_tar.sh uspcfg.txt ISOMIP ISOMIP_ARCHIVE |
---|
47 | |
---|
48 | 3. Copy the resulting tarball (in this case: ISOMIP_ARCHIVE.tar) to the target |
---|
49 | system and unpack (tar xvf ISOMIP_ARCHIVE.tar) in a location that is visible to |
---|
50 | the node on which you intend to compile nemo. The unpacked directory will contain |
---|
51 | the files retrieved from the remote server, modified versions of the file list and |
---|
52 | uspcfg.txt files and two new scripts. For example: |
---|
53 | |
---|
54 | ls -1R ISOMIP_ARCHIVE |
---|
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 |
---|
63 | |
---|
64 | ./EXP00: |
---|
65 | iodef.xml - downloaded from remote server |
---|
66 | namelist_cfg - downloaded from remote server |
---|
67 | |
---|
68 | ./MY_SRC: |
---|
69 | domzgr.F90 - downloaded from remote server |
---|
70 | istate.F90 - downloaded from remote server |
---|
71 | |
---|
72 | 4. The final stage is to enter the directory and execute the set_local_uspcfg script. |
---|
73 | This script will prompt for a full path to the target CONFIG directory and then: |
---|
74 | |
---|
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) |
---|
77 | b. move uspcfg_local.txt to the named CONFIG directory |
---|
78 | c. rename any existing uspcfg.txt file in the CONFIG directory to uspcfg_remote.txt |
---|
79 | d. insert symbolic link (uspcfg.txt) to uspcfg_local.txt in the CONFIG directory |
---|
80 | e. redefine/define wget as an exported bash function to simply copy |
---|
81 | |
---|
82 | This last action is needed so that subsequent use of makenemo with the -u argument |
---|
83 | will not invoke wget. For this to be effective the set_local_usp script should be run |
---|
84 | within the same bash shell as makenemo will be run in. I.e.: |
---|
85 | |
---|
86 | . ./set_local_usp |
---|
87 | |
---|
88 | If this is not possible or the makenemo command is run at a later date, then the |
---|
89 | def_wget script should be run in the bash shell before any attempt to use the -u |
---|
90 | option of makenemo. I.e.: |
---|
91 | |
---|
92 | . ./def_wget |
---|
93 | |
---|
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 | |
---|
118 | 5. The setup is now complete and moving to the CONFIG directory and issuing a command |
---|
119 | such as: |
---|
120 | |
---|
121 | ./makenemo -n MYISOMIP -u ISOMIP -m target_arch |
---|
122 | |
---|
123 | should correctly configure from local archives only. |
---|
124 | |
---|
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 | |
---|