diff --git a/.gitignore b/.gitignore index 5c45268686b2e1c0841af0a95d36fc05b4a4e745..2d965cb2b053eb74ad655705a7bdecf70dec9655 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,10 @@ !/mnh_expand/.gitkeep # Ignore the content of testprogs_data but not the directory itself -/testprogs_data/** -!/testprogs_data/.gitkeep +/testprogs_data/ice_adjust/** +/testprogs_data/rain_ice/** +!/testprogs_data/ice_adjust/.gitkeep +!/testprogs_data/rain_ice/.gitkeep # Ignore vim swapp files .*.swp diff --git a/INSTALL b/INSTALL index 3b21b97b773a70f667c9021fdd313c00347b6a88..8e988c4f20799bfecb741701d90e0edf6a2e0a71 100644 --- a/INSTALL +++ b/INSTALL @@ -12,3 +12,7 @@ Some installations are needed: 3) MNH_EXPAND This tool is composed of two parts: the filepp software, and the MNH_Expand_Array package. Installation is described in ** INSTALL_mnh_expand ** + +4) TESTPROGS REFERENCE DATA + The script check\_commit\_testprogs.sh needs reference data. + The data generation is explained in ** INSTALL_testprogs ** diff --git a/INSTALL_testprogs b/INSTALL_testprogs index bbeb43f462ab8a910d9ae24de76b918840768c84..7d63812c1e61e448cc838ad36c63031225abf48f 100644 --- a/INSTALL_testprogs +++ b/INSTALL_testprogs @@ -1,8 +1,6 @@ -Testprogs data on sxphynh +The testprogs_data directory must be filled by reference data. +These data are generated according to the description provided in the Offline documentation. -cd testprogs_data -mkdir ice_adjust -cd ice_adjust -git clone git@github.com:pmarguinaud/ice_adjust.git -mv ice_adjust/data/* . -rm -rf ice_adjust/ +The check_commit_testprogs.sh script will run offline simulations in the directory given +by the environment variable TESTPROGSDIR ($HOME/TESTPROGS will be used if the variable is not set). +This directory must exist. diff --git a/README.md b/README.md index b9629700f0270caa806041b07fdc19a0a5345cb1..55c75db8985e0736bd90ae41cd1bfd19126e47ac 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ -# PHYEX_tools +# PHYEX\_tools This package contains tools related to the PHYEX package (https://github.com/QuentinRodier/PHYEX). -Specifically, the prep_code.sh scripts prepare the source code for inclusion in the compilation machinery +Specifically, the prep\_code.sh scripts prepare the source code for inclusion in the compilation machinery of the different models. -And, the check_commit_ial.sh script compiles, executes IAL test cases and compares the results againts a reference simulation. +And, the check\_commit\_ial.sh script compiles, executes IAL test cases and compares the results againts a reference simulation. -Moreover, the check_commit_mesonh.sh script compiles, executes a test case and compares the results againts a reference simulation. +Moreover, the check\_commit\_mesonh.sh script compiles, executes a test case and compares the results againts a reference simulation. + +The check\_commit\_testprogs.sh does the same for the offline test programs. + +verify\_mnh\_expand.py checks the conformace of the code regarding mnh\_expand directives. ## Installation @@ -14,9 +18,10 @@ Instructions can be found in INSTALL file. ## Usage -Help on check_commit_ial.sh, check_commit_mesonh.sh and prep_code.sh can be printed with the '-h' option. +Help on check\_commit\_ial.sh, check\_commit\_mesonh.sh, check\_commit\_testprogs.sh, +verify\_mnh\_expand.py and prep\_code.sh can be printed with the '-h' option. -For check_commit_mesonh.sh the following environment variables can be set: +For check\_commit\_mesonh.sh the following environment variables can be set: * MNHPACK: directory in which MNH pack will be created (default is $HOME/MesoNH/PHYEX) -* REFDIR: directory in which reference pack can be found (default is the pack directory near the check_commit_mesonh.sh file) -* TARGZDIR: directory in which the tar.gz file can be found (default is the pack directory near the check_commit_mesonh.sh file) +* REFDIR: directory in which reference pack can be found (default is the pack directory near the check\_commit\_mesonh.sh file) +* TARGZDIR: directory in which the tar.gz file can be found (default is the pack directory near the check\_commit\_mesonh.sh file) diff --git a/TODO b/TODO deleted file mode 100644 index 3e2e3c2bde63262ec4e29eb831370253927034f7..0000000000000000000000000000000000000000 --- a/TODO +++ /dev/null @@ -1,4 +0,0 @@ -Supprimer répertoire Tools en modifiant le script diffNODE.001_01 -Déplacer les scripts dans un répertoire -Activer le cas ARMCU -Rendre le cas big_3D utilisable sur taranis diff --git a/Tools/Frame.pm b/Tools/Frame.pm deleted file mode 100644 index 22e34c840e764b2b98baa5d58364068326b5af20..0000000000000000000000000000000000000000 --- a/Tools/Frame.pm +++ /dev/null @@ -1,68 +0,0 @@ -package Tools::Frame; - -use strict; -use base qw (Exporter); -our @EXPORT = qw (frame); - -sub frame -{ - my ($t, $width, $border) = @_; - my $len = length ($t); - - $border = 1 unless (defined ($border)); - - my $S = ' '; - - my ($C, $V, $H) = ('*', '|', '-'); - - ($C, $V, $H) = (' ', ' ', ' ') - unless ($border); - - my $df = 3; - $width ||= $len + 2 * $df; - - my $line1 = $C . ($H x ($width-2)) . $C; - my $line2 = $V . ($S x ($width-2)) . $V; - - - my $TEXT = ''; - - $TEXT .= "$line1\n"; - for (1 .. ($df-1)/2) - { - $TEXT .= "$line2\n"; - } - - die ("Cannot frame text: `$t'\n") - if ($width - 2 * $df <= 0); - - while ($t) - { - my $s = substr ($t, 0, $width - 2 * $df, ''); - - my $i = 0; - while (length ($s) < $width - 2 * $df) - { - if ($i % 2) - { - $s = " $s"; - } - else - { - $s = "$s "; - } - $i++; - } - my $linet = $V . ($S x ($df-1)) . $s . ($S x ($df-1)) . $V; - $TEXT .= "$linet\n"; - } - - for (1 .. ($df-1)/2) - { - $TEXT .= "$line2\n"; - } - $TEXT .= "$line1\n"; -} - - -1; diff --git a/check_commit_testprogs.sh b/check_commit_testprogs.sh index ec7c0c10015d0c34b913dde1e782adef91aa07f9..46cca3aad0433f4a456d8a9caec13804606352c8 100755 --- a/check_commit_testprogs.sh +++ b/check_commit_testprogs.sh @@ -10,7 +10,7 @@ set -e #ice_adjust: the ice adjust test case specialName="ref" -availTests="ice_adjust" +availTests="ice_adjust,rain_ice" defaultTest='ALL' separator='_' #- seprator must be in sync with prep_code.sh separator @@ -82,7 +82,7 @@ while [ -n "$1" ]; do shift done -TESTDIR=${TESTDIR:=$HOME/TESTPROGS} +TESTDIR=${TESTPROGSDIR:=$HOME/TESTPROGS} function exescript () { #usage: exescript <output file> <script> [arg [arg ...]] diff --git a/conf_tests/small_3D/aro48t1.sh b/conf_tests/small_3D/aro48t1.sh index c459620a2632bb0b90f6a45b8c084cb58ed02807..e4dee94ab7fedf14b4354eef27618864b8095488 100755 --- a/conf_tests/small_3D/aro48t1.sh +++ b/conf_tests/small_3D/aro48t1.sh @@ -1189,6 +1189,7 @@ ls # cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID #fi cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ /bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* /bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* /bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) diff --git a/diffNODE.001_01 b/diffNODE.001_01 index 83c6fa6becd543db0ddd85d37dcc634ebd7c752e..d33640104415782a37f87e7c0c49acd84be02a80 100755 --- a/diffNODE.001_01 +++ b/diffNODE.001_01 @@ -4,7 +4,8 @@ use strict; use FindBin qw ($Bin); use lib $Bin; use FileHandle; -use Tools::Frame; +#Frame was inlined in this script +#use Tools::Frame; use Data::Dumper; use POSIX qw (floor); use Getopt::Long; @@ -16,6 +17,66 @@ my %opts = ( 'jo-max-diff' => .030000, ); +sub frame +{ + my ($t, $width, $border) = @_; + my $len = length ($t); + + $border = 1 unless (defined ($border)); + + my $S = ' '; + + my ($C, $V, $H) = ('*', '|', '-'); + + ($C, $V, $H) = (' ', ' ', ' ') + unless ($border); + + my $df = 3; + $width ||= $len + 2 * $df; + + my $line1 = $C . ($H x ($width-2)) . $C; + my $line2 = $V . ($S x ($width-2)) . $V; + + + my $TEXT = ''; + + $TEXT .= "$line1\n"; + for (1 .. ($df-1)/2) + { + $TEXT .= "$line2\n"; + } + + die ("Cannot frame text: `$t'\n") + if ($width - 2 * $df <= 0); + + while ($t) + { + my $s = substr ($t, 0, $width - 2 * $df, ''); + + my $i = 0; + while (length ($s) < $width - 2 * $df) + { + if ($i % 2) + { + $s = " $s"; + } + else + { + $s = "$s "; + } + $i++; + } + my $linet = $V . ($S x ($df-1)) . $s . ($S x ($df-1)) . $V; + $TEXT .= "$linet\n"; + } + + for (1 .. ($df-1)/2) + { + $TEXT .= "$line2\n"; + } + $TEXT .= "$line1\n"; +} + sub xave { diff --git a/testprogs_data/ice_adjust/.gitkeep b/testprogs_data/ice_adjust/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testprogs_data/rain_ice/.gitkeep b/testprogs_data/rain_ice/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testprogs_data/shallow_mf/.gitkeep b/testprogs_data/shallow_mf/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testprogs_data/turb/.gitkeep b/testprogs_data/turb/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/update_from_sxphynh.sh b/update_from_sxphynh.sh deleted file mode 100755 index cc1d53de0c4bce39f05afcbcf2984e282db956b2..0000000000000000000000000000000000000000 --- a/update_from_sxphynh.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -touch /scratch/work/riette/202005_externalisation_physique/update_from_sxphynh.sh - -for file in check_commit_ial.sh comp_DDH.py diffNODE.001_01 Tools prep_code.sh conf_tests update_from_sxphynh.sh env.sh; do - rsync -rltp --delete --timeout=30 \ - sxphynh.cnrm.meteo.fr:/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/$file \ - /scratch/work/riette/202005_externalisation_physique/ -done