Subversion Repositories lagranto.ecmwf

Rev

Rev 36 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36 Rev 39
Line 19... Line 19...
19
# Set paths for development and for synchronisation (operational)
19
# Set paths for development and for synchronisation (operational)
20
set path_devel = "${DYN_TOOLS}//lagranto.ecmwf/"
20
set path_devel = "${DYN_TOOLS}//lagranto.ecmwf/"
21
set path_sync  = "${DYN_TOOLS}/lagranto/"
21
set path_sync  = "${DYN_TOOLS}/lagranto/"
22
 
22
 
23
# Set Fortran compiler
23
# Set Fortran compiler
24
setenv FORTRAN  pgf90
24
setenv FORTRAN pgf90 
25
 
25
 
26
# Set netcdf format (ive, cdo, mch) 
26
# Set netcdf format (ive, cdo, mch) 
27
set ncdf = cdo
27
set ncdf = ive 
28
 
28
 
29
# Init netCDF library depending on the Fortran compiler
29
# Init netCDF library depending on the Fortran compiler
30
if ( "${FORTRAN}" == "pgf90" ) then
30
if ( "${FORTRAN}" == "pgf90" ) then
31
  module load netcdf/4.2.1-pgf90
31
  module load netcdf/4.2.1-pgf90
32
  module list
32
  module list
Line 34... Line 34...
34
else if ( "${FORTRAN}" == "gfortran" ) then
34
else if ( "${FORTRAN}" == "gfortran" ) then
35
  module load gfortran
35
  module load gfortran
36
  module load netcdf/4.2.1
36
  module load netcdf/4.2.1
37
 
37
 
38
else if ( "${FORTRAN}" == "ifort" ) then
38
else if ( "${FORTRAN}" == "ifort" ) then
39
  module load ifort/10.1.017
39
  module load intel
40
  module load netcdf/4.1.1-ifort
40
  module load netcdf/4.3.2-intel
41
 
41
 
42
else
42
else
43
  echo "Fortran Compiler ${FORTRAN} not supported... Exit"
43
  echo "Fortran Compiler ${FORTRAN} not supported... Exit"
44
  exit 1
44
  exit 1
45
 
45
 
Line 73... Line 73...
73
 
73
 
74
# Set list of core programs
74
# Set list of core programs
75
set core  = "create_startf caltra trace select density lidar"
75
set core  = "create_startf caltra trace select density lidar"
76
 
76
 
77
# Set list of goodies
77
# Set list of goodies
78
set tools = "traj2num lsl2rdf changet extract getmima gettidiff getvars list2lsl lsl2list mergetra newtime reformat timeres trainfo difference datelist tracal" 
78
set goodies = "lsl2rdf changet extract getmima gettidiff getvars list2lsl lsl2list mergetra newtime reformat timeres trainfo difference datelist" 
-
 
79
 
-
 
80
# Set list of tools
-
 
81
set tools = "traj2num tracal footprint" 
79
 
82
 
80
# Set list of libraries
83
# Set list of libraries
81
set libs  = "iotra ioinp inter times libcdfio libcdfplus"
84
set libs  = "iotra ioinp inter times libcdfio libcdfplus"
82
 
85
 
83
# Core programs
86
# Core programs
Line 87... Line 90...
87
      set mode  = "core"
90
      set mode  = "core"
88
   endif
91
   endif
89
end
92
end
90
 
93
 
91
# Goodies
94
# Goodies
-
 
95
foreach tool ( $goodies )
-
 
96
   if ( "${tool}" == "${mode}" ) then
-
 
97
      set goodies = ${tool}
-
 
98
      set mode    = "goodies"
-
 
99
   endif
-
 
100
end
-
 
101
 
-
 
102
# Tools
92
foreach tool ( $tools )
103
foreach tool ( $tools )
93
   if ( "${tool}" == "${mode}" ) then
104
   if ( "${tool}" == "${mode}" ) then
94
      set tools = ${tool}
105
      set tools = ${tool}
95
      set mode  = "goodies"
106
      set mode  = "tools"
96
   endif
107
   endif
97
end
108
end
98
 
109
 
99
# Libraries
110
# Libraries
100
foreach lib ( $libs )
111
foreach lib ( $libs )
Line 107... Line 118...
107
# Check that the mode is ok 
118
# Check that the mode is ok 
108
if ( "${mode}" == "all"     ) goto modeok
119
if ( "${mode}" == "all"     ) goto modeok
109
if ( "${mode}" == "lib"     ) goto modeok
120
if ( "${mode}" == "lib"     ) goto modeok
110
if ( "${mode}" == "core"    ) goto modeok
121
if ( "${mode}" == "core"    ) goto modeok
111
if ( "${mode}" == "goodies" ) goto modeok
122
if ( "${mode}" == "goodies" ) goto modeok
-
 
123
if ( "${mode}" == "tools"   ) goto modeok
112
if ( "${mode}" == "links"   ) goto modeok
124
if ( "${mode}" == "links"   ) goto modeok
113
if ( "${mode}" == "clean"   ) goto modeok
125
if ( "${mode}" == "clean"   ) goto modeok
114
if ( "${mode}" == "docu"    ) goto modeok
126
if ( "${mode}" == "docu"    ) goto modeok
115
if ( "${mode}" == "sync"    ) goto modeok
127
if ( "${mode}" == "sync"    ) goto modeok
116
echo "Unsupported mode ${mode} ... Stop"
128
echo "Unsupported mode ${mode} ... Stop"
Line 341... Line 353...
341
echo "Installing Lagranto goodies"
353
echo "Installing Lagranto goodies"
342
echo "-----------------------------------------------------------------"
354
echo "-----------------------------------------------------------------"
343
 
355
 
344
cd ${LAGRANTO}/goodies
356
cd ${LAGRANTO}/goodies
345
 
357
 
346
foreach tool ( $tools )
358
foreach tool ( $goodies )
347
 
359
 
348
echo
360
echo
349
echo "----- ${tool}"
361
echo "----- ${tool}"
350
echo
362
echo
351
\rm -f ${tool}.o
363
\rm -f ${tool}.o
Line 377... Line 389...
377
echo "-----------------------------------------------------------------"
389
echo "-----------------------------------------------------------------"
378
echo
390
echo
379
 
391
 
380
cd ${LAGRANTO}/goodies
392
cd ${LAGRANTO}/goodies
381
 
393
 
382
foreach tool ( $tools )
394
foreach tool ( $goodies )
383
 
395
 
384
if ( ! -f ${tool} ) then
396
if ( ! -f ${tool} ) then
385
  echo "${tool} is missing... Stop"
397
  echo "${tool} is missing... Stop"
386
  exit 1
398
  exit 1
387
else
399
else
Line 394... Line 406...
394
 
406
 
395
# Exit if only goodies should be installed
407
# Exit if only goodies should be installed
396
if ( "${mode}" == "goodies" ) exit 0
408
if ( "${mode}" == "goodies" ) exit 0
397
 
409
 
398
# -----------------------------------------------------------------------------
410
# -----------------------------------------------------------------------------
-
 
411
# Compile Lagrango tools
-
 
412
# -----------------------------------------------------------------------------
-
 
413
 
-
 
414
if ( ("${mode}" == "all" ) | ("${mode}" == "tools" ) ) then
-
 
415
 
-
 
416
echo
-
 
417
echo "-----------------------------------------------------------------"
-
 
418
echo "Installing Lagranto tools"
-
 
419
echo "-----------------------------------------------------------------"
-
 
420
 
-
 
421
cd ${LAGRANTO}/tools
-
 
422
 
-
 
423
foreach tool ( $tools )
-
 
424
 
-
 
425
echo
-
 
426
echo "----- ${tool}"
-
 
427
echo
-
 
428
\rm -f ${tool}.o
-
 
429
\rm -f ${tool}
-
 
430
if ( -f ${tool}.make ) then
-
 
431
   make -f ${tool}.make
-
 
432
else if ( -f ${tool}.install ) then
-
 
433
   ./${tool}.install
-
 
434
endif
-
 
435
 
-
 
436
if ( ! -f ${tool} ) then
-
 
437
  echo "Problem in compiling ${tool} ... Stop"
-
 
438
  exit 1
-
 
439
endif
-
 
440
 
-
 
441
end
-
 
442
 
-
 
443
endif
-
 
444
 
-
 
445
if ( "${mode}" == "tools" ) exit 0
-
 
446
 
-
 
447
# -----------------------------------------------------------------------------
-
 
448
# Check that all Lagranto tools are available
-
 
449
# -----------------------------------------------------------------------------
-
 
450
 
-
 
451
echo
-
 
452
echo "-----------------------------------------------------------------"
-
 
453
echo "Check that all Lagranto tools are available"
-
 
454
echo "-----------------------------------------------------------------"
-
 
455
echo
-
 
456
 
-
 
457
cd ${LAGRANTO}/tools
-
 
458
 
-
 
459
foreach tool ( $tools )
-
 
460
 
-
 
461
if ( ! -f ${tool} ) then
-
 
462
  echo "${tool} is missing... Stop"
-
 
463
  exit 1
-
 
464
else
-
 
465
  ls -l ${tool} 
-
 
466
endif
-
 
467
 
-
 
468
end
-
 
469
 
-
 
470
endif
-
 
471
 
-
 
472
# Exit if only goodies should be installed
-
 
473
if ( "${mode}" == "tools" ) exit 0
-
 
474
 
-
 
475
# -----------------------------------------------------------------------------
399
# Create links to programs
476
# Create links to programs
400
# -----------------------------------------------------------------------------
477
# -----------------------------------------------------------------------------
401
 
478
 
402
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
479
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
403
 
480
 
Line 440... Line 517...
440
ln -svf ${LAGRANTO}/trace/trace.sh          trace
517
ln -svf ${LAGRANTO}/trace/trace.sh          trace
441
ln -svf ${LAGRANTO}/density/density.sh      density
518
ln -svf ${LAGRANTO}/density/density.sh      density
442
ln -svf ${LAGRANTO}/startf/create_startf.sh startf
519
ln -svf ${LAGRANTO}/startf/create_startf.sh startf
443
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar
520
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar
444
 
521
 
445
foreach tool ( $tools )
522
foreach tool ( $goodies )
446
 
-
 
447
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.sh 
523
  ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.sh 
448
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.ecmwf
524
  ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.ecmwf
449
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool} 
525
  ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool} 
-
 
526
end
450
 
527
 
-
 
528
foreach tool ( $tools )
-
 
529
  ln -svf ${LAGRANTO}/tools/${tool}.sh     ${tool}.sh 
-
 
530
  ln -svf ${LAGRANTO}/tools/${tool}.sh     ${tool}.ecmwf
-
 
531
  ln -svf ${LAGRANTO}/tools/${tool}.sh     ${tool} 
451
end
532
end
452
 
533
 
453
# Set link for create_startf / startf
534
# Set link for create_startf / startf
454
\rm -f ${LAGRANTO}/startf
535
\rm -f ${LAGRANTO}/startf
455
ln -svf ${LAGRANTO}/create_startf ${LAGRANTO}/startf
536
ln -svf ${LAGRANTO}/create_startf ${LAGRANTO}/startf
Line 486... Line 567...
486
ln -svf ${path_devel}/density/density.sh         density.ecmwf
567
ln -svf ${path_devel}/density/density.sh         density.ecmwf
487
ln -svf ${path_devel}/startf/create_startf.sh    startf.ecmwf
568
ln -svf ${path_devel}/startf/create_startf.sh    startf.ecmwf
488
ln -svf ${path_devel}/lidar/lidar.sh             lidar.ecmwf
569
ln -svf ${path_devel}/lidar/lidar.sh             lidar.ecmwf
489
ln -svf ${path_devel}/lidar/seltra.sh            seltra.ecmwf
570
ln -svf ${path_devel}/lidar/seltra.sh            seltra.ecmwf
490
 
571
 
-
 
572
foreach tool ( $goodies )
-
 
573
  ln -svf ${path_devel}/goodies/${tool}.sh         ${tool}.ecmwf
-
 
574
end
491
foreach tool ( $tools )
575
foreach tool ( $tools )
492
 
-
 
493
ln -svf ${path_devel}/goodies/${tool}.sh         ${tool}.ecmwf
576
  ln -svf ${path_devel}/tools/${tool}.sh           ${tool}.ecmwf
494
 
-
 
495
end
577
end
496
 
578
 
497
# Set all permissions
579
# Set all permissions
498
chmod -R og+rx ${path_sync}/bin/
580
chmod -R og+rx ${path_sync}/bin/
499
 
581