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.
user/techene/TP_live – NEMO
wiki:user/techene/TP_live

Version 21 (modified by techene, 3 years ago) (diff)

--

Install NEMO and run it

Get the source

https://owncloud.locean-ipsl.upmc.fr/index.php/s/MIDmP18cvAkd0xl

Put the source at the right location

cp MODNUM.tar.gz $HOME

Go in the HOME

cd $HOME

...to extract

tar xvfz MODNUM.tar.gz

Compile it

cd MODNUM 
cd nemo

 ./makenemo -m GCC_LINUX -j 4 -r PAC2

The compilation command is written in README_compile.

in case of problem

  • check your are in $HOME
  • check $HOME=/home/utl1
  • check the command you used to compile !

Then run the code

cd cfgs
cd PAC2
cd EXP00

check nemo executable is available

ls

need to update path

this variable has to be update each time you change terminal

export LD_LIBRARY_PATH=$HOME/MODNUM/util/netcdf-fortran-4.5.3/lib:$HOME/MODNUM/util/netcdf-c-4.7.4/lib:$HOME/MODNUM/util/hdf5-1.10.7/lib
mpirun -np 4 ./nemo

The run procedure is written in README_run.

pay attention

  • do not run several NEMO at the same location (you will only produce corrupted outputs) ps -edf to check what is running on your computer.
  • rm

Look at the output

pwd 
ls
ncview blablabla.nc

in case of problem (there is a bug in the current version)

in file_def_nemo-oce.xml

change one_file for multiple_file 

in namelist_cfg

nn_leapy = 0 

with these parameters... run again a NEMO simulation (check LD path is OK)

mpirun -np 4 ./nemo

To speed up NEMO divides the domain into 4 part (in this case). Now you have to gather again. It seems that there is a bug in NEMO rebuilt. So you have to output all the files by proc and rebuild the file "by hand".

rm PAC2_1m_19940101_19941231_grid_T.nc
./rebuild -o PAC2_1m_19940101_19941231_grid_T.nc PAC2_1m_19940101_19941231_grid_T_00*

Now you can visualise the whole bassin with ncview.

rm PAC2_1m_19940101_19941231_grid_T.nc 
rm PAC2_1m_19940101_19941231_grid_U.nc 
rm PAC2_1m_19940101_19941231_grid_V.nc 
rm PAC2_1m_19940101_19941231_grid_W.nc 
rm PAC2_1d_19940101_19941231_grid_T.nc 
rm PAC2_1d_19940101_19941231_grid_U.nc 
rm PAC2_1d_19940101_19941231_grid_V.nc 
rm PAC2_1d_19940101_19941231_grid_W.nc 

./rebuild -o PAC2_1m_19940101_19941231_grid_T.nc PAC2_1m_19940101_19941231_grid_T_00*
./rebuild -o PAC2_1m_19940101_19941231_grid_U.nc PAC2_1m_19940101_19941231_grid_U_00*
./rebuild -o PAC2_1m_19940101_19941231_grid_V.nc PAC2_1m_19940101_19941231_grid_V_00*
./rebuild -o PAC2_1m_19940101_19941231_grid_W.nc PAC2_1m_19940101_19941231_grid_W_00*
./rebuild -o PAC2_1d_19940101_19941231_grid_T.nc PAC2_1d_19940101_19941231_grid_T_00*
./rebuild -o PAC2_1d_19940101_19941231_grid_U.nc PAC2_1d_19940101_19941231_grid_U_00*
./rebuild -o PAC2_1d_19940101_19941231_grid_V.nc PAC2_1d_19940101_19941231_grid_V_00*

This was the first year

Now we can run interesting things... The first simulation ran 1 year but NEMO is able to restart after this one year.

Run the second year

In order to produce this new simulation you have to change the parameters file here called 'namelist_cfg'.

vi namelist_cfg

To tell NEMO to restart from previous simulation results you have to modify it the namrun block as such.

ln_rstart    = .true.
nn_rstctl    =    2   
cn_ocerst_in = PAC2_*_restart  (with the correct name of restart file)
nn_it000= 4381 (nn_itend year before +1) avec un pas de temps de 2h
nn_itend= 1year duration = 4380+4*4380 = 21900

nn_it000 is the first time step of the first year we have to simulate which is actually the second year of the bunch. nn_itend is the end of the bunch if year we want to simulate. cn_ocerst_in is the pattern for the restart file name.

All parameters from a student.

cn_exp = "PAC2" ! experience name
nn_it000 = 4381 ! first time step
nn_itend = 21900 ! last time step
nn_date0 = 19940101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
nn_leapy = 0 ! Leap year calendar (1) or not (0)
ln_rstart = .true. ! start from rest (F) or from a restart file (T)
cn_ocerst_in = "PAC2_00004380_restart" ! suffix of ocean restart name (input)
cn_ocerst_indir = "." ! directory from which to read input ocean restarts
nn_rstctl = 2 ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart 

These is a bug : the simulation does not end properly since it misses time steps of december.

Try to explain what you see

2016 is a normal year : identify upwellings, sea surface temperature / height evolution...

moyenne annuelle

ncks -d time_counter 0,100 fic1.nc fic2.nc 

attention au type de fichier journalier ou mensuel donc les pas de temps doivent etre traités avec attention, attention on part de 0

Avec cdo

#selection année
selyear,1996 fil1.nc file2.nc 
ncra fic2.nc fic3.nc
cdo yearmean file1.nc file2.nc
ncks -d time_counter,0,6 PAC2_1m_19960101_19961231_grid_T.nc 1996_sem1mean.nc
ncks -d y,-10,10 PAC2_1m_19960101_19961231_grid_T.nc 1996_zonalmean.nc
cdo seasmean PAC2_1m_19950101_19981231_grid_T.nc PAC2_3m_19950101_19981231_grid_T.nc
cdo showdate PAC2_3m_19950101_19981231_grid_T.nc
cdo selyear,1996 -selseason,DJF PAC2_3m_19950101_19981231_grid_T.nc PAC2_winter1996_grid_T.nc
cdo selyear,1997 -selseason,DJF PAC2_3m_19950101_19981231_grid_T.nc PAC2_winter_1996-1997_grid_T.nc
ncks -O -d time_counter,0 file_in.nc file_in.nc 

Regarder les autres années ex 2017

coup de vent

c'est a eux a implémenter

Change the code

linea 487:

 DO jj = 1, jpjm1
      DO ji = 1, fs_jpim1
            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) &
               &          * MAtmask(ji,jj,1),tmask(ji+1,jj,1))
            vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) &
               &          * MAtmask(ji,jj,1),tmask(ji,jj+1,1))
      END DO
 END DO
 CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1. )
 IF( ( nyear == 1997 .AND. nmonth == 2 .AND. nday > 15 ) .OR. ( nyear == 1997 .AND. nmonth == 3 .AND. nday < 20 ) ) THEN
      WHERE( (glamt > 0. .OR. glamt < -170.) .AND. ABS(gphit) <= 15. .AND. utau > 0 ) utau(:, = 0.
 ENDIF