|
| 1 | + |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +#IKT, WARNING: the following 3 lines are specific to Irina Tezaur's machine, camobap! |
| 5 | +#They need to be changed for other machines! |
| 6 | +export LD_LIBRARY_PATH=/usr/lib64:/usr/lib:/tpls/install/bin |
| 7 | +export PATH=$PATH:/MATLAB/R2021b/bin:/tpls/install/include:/nightlyAlbanyTests/Results/Trilinos/build/install/bin |
| 8 | +mpirun=/tpls/install/bin/mpirun |
| 9 | + |
| 10 | +rm -rf *exo* |
| 11 | +rm -rf albanyMesh/*exo* |
| 12 | + |
| 13 | +# CISM-ALBANY |
| 14 | + |
| 15 | +# run cism-albany after modifying (if needed) the paths of the input nc "name" file and the "dycore_input_file" in the file inputFiles/cism-albanyT.config. |
| 16 | +cd inputFiles |
| 17 | +rm -rf *exo* |
| 18 | +mpirun -np 8 ../cism_driver/cism_driver cism-albanyT.config |
| 19 | +epu --auto greenland_cism-albanyT.exo.8.0 |
| 20 | +cd .. |
| 21 | + |
| 22 | +# [optional] if you run the above on multiple processors, you need to merge the exodus files into one: |
| 23 | +#epu --auto greenland_cism-albanyT.exo.4. |
| 24 | + |
| 25 | +#note that if you diff the original greenland.nc file and the one stored by cism greenland_cism-albanyT.nc, beta changed a bit. |
| 26 | + |
| 27 | +#STANDALONE-ALBANY |
| 28 | + |
| 29 | +#-- Generation of ascii files using matlab. |
| 30 | + |
| 31 | +#move to mFiles directory |
| 32 | +cd mFiles |
| 33 | + |
| 34 | +# modify (if needed) maltab script "build_cism_msh_from_nc" to fix input/output paths and filenames. |
| 35 | +# run matlab script "build_cism_msh_from_nc" |
| 36 | +/MATLAB/R2021b/bin/matlab -batch "build_cism_msh_from_nc; settings; exit" |
| 37 | + |
| 38 | +#move back to top directory |
| 39 | +cd .. |
| 40 | + |
| 41 | +#create 2d exodus file for Greenland. |
| 42 | +#Warning!! this part is very hacky, you'll get a runtime error, but the correct *.exo will be saved in the albanyMesh folder. Also, this can be extremely slow with large files, unless trilinos is compiled with the nodebug option -D CMAKE_CXX_FLAGS:STRING="-O3 -fPIC -fno-var-tracking -DNDEBUG". |
| 43 | +mpirun -np 8 Albany inputFiles/create2dExo.yaml |
| 44 | + |
| 45 | + |
| 46 | +#run standalone Albany simulation |
| 47 | +mpirun -np 8 Albany inputFiles/input_standalone-albanyT.yaml |
| 48 | +cd albanyMesh |
| 49 | +epu --auto greenland_2d.exo.8.0 |
| 50 | +cd .. |
| 51 | +# [optional] if you run the above on multiple processors, you need to merge the exodus files into one: |
| 52 | +#$ path-to-trilinos-install/bin/epu --auto greenland_cism-albanyT.exo.4. |
| 53 | + |
| 54 | +epu --auto greenland_standalone-albanyT.exo.8.0 |
| 55 | + |
| 56 | +#COMPARE CISM-ALBANY with STANDALONE ALBANY |
| 57 | +#move to mFiles directory |
| 58 | +cd mFiles |
| 59 | + |
| 60 | +#run the script compare_exos.m |
| 61 | +/MATLAB/R2021b/bin/matlab -batch "compare_exos; settings; exit" |
| 62 | + |
| 63 | +# you'll see the max difference (in absolut value) between fields. Note that the raher significant difference in beta comes from the fact that beta is changed in cism according to the floating condition. |
| 64 | + |
| 65 | +#STORE STANDALONE ALBANY FIELDS INTO nc. |
| 66 | +#create a copy of greenland.nc |
| 67 | +cp ../ncGridSamples/greenland.nc ../greenland_standalone-albanyT.nc |
| 68 | +/MATLAB/R2021b/bin/matlab -batch "print_exo_fields_into_nc; settings; exit" |
| 69 | + |
| 70 | + |
| 71 | +#Note: When the thickness and the bedrock topography are interpolated back to the grid, some accuracy is lost (try comparing the original "greenland.nc" with the newly created "geenland_standalone-albanyT.nc"). In fact, if you now re-run cism-alabny #using the new nc grid you'll see a significant difference with the standalone albany solution: |
| 72 | + |
| 73 | +#move back to top folder |
| 74 | +cd .. |
| 75 | + |
| 76 | +#after modifying the inputFiles/cism-albanyT.config to use the new gid greenland_standalone-albanyT.nc, run cism-albanyT, and compare again |
| 77 | +cd inputFiles |
| 78 | +mpirun -np 8 ../cism_driver/cism_driver cism-albanyT.config |
| 79 | +epu --auto greenland_cism-albanyT.exo.8.0 |
| 80 | +cd .. |
| 81 | + |
| 82 | +cd mFiles |
| 83 | +/MATLAB/R2021b/bin/matlab -batch "compare_exos; settings; exit" |
| 84 | + |
| 85 | +#quite a difference.. this is an interpolation error.. so it should diminish as the grid is refined. |
| 86 | + |
0 commit comments