forked from knaughten/roms_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file_guide.txt
1541 lines (1387 loc) · 76.4 KB
/
file_guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
***GENERATING INPUT FILES***
cice_grid.py: Given a ROMS grid file, create corresponding CICE grid and kmt
(land mask) files.
To run: Open python or ipython, and type "run cice_grid.py." The
script will prompt you for paths to the existing ROMS
grid file and the desired CICE grid and kmt files.
woa_netcdf.py: Converts World Ocean Atlas temperature and salinity data from
text file (FESOM input format) to NetCDF.
To run: First edit user parameters (file paths) near the top of
the file. Then open python/ipython and type "run
woa_netcdf.py".
romscice_ini_woa.py: Builds a ROMS initialisation file using World Ocean Atlas
data for temperature and salinity; starts with a motionless
ocean and zero sea surface height. Under ice shelves,
extrapolates temperature and salinity using
nearest-neighbour techniques. Uses WOA data assumed to be
converted from FESOM input using woa_netcdf.py.
To run: First edit user parameters (file paths and grid
parameters) near the bottom of the file (after the
Then make sure that you have scipy version 0.14 or
higher (on raijin, this means switching to
python/2.7.6; instructions at the top of the file).
Then open python/ipython and type "run
romscice_ini_woa.py".
romscice_ini_ecco.py: Builds a ROMS initialisation file using ECCO2 data for
temperature and salinity; starts with a motionless ocean
and zero sea surface height. In ice shelf cavities,
temperature and salinity are linearly extrapolated
using nearest-neighbour as in romscice_ini_woa.py.
To run: First edit user parameters (file paths and grid
parameters) near the bottom of the file. Then make
sure that you have scipy version 0.14 or higher
(on raijin, this means switching to python/2.7.6;
instructions at the top of the file). Then open
python/ipython and type "run romscice_ini.py".
romscice_nbc.py: Builds a ROMS northern lateral boundary condition file from 1
year of monthly ECCO2 data for temperature, salinity, and
meridional velocity (set zonal velocity and sea surface height
to zero). Also contains useful code for calculating volume
averages.
To run: Edit user parameters near the top of the script
(mainly just file paths). Then make sure that you have
scipy version 0.14 or higher (on raijin, this means
switching to python/2.7.6; instructions at the top
of the file). Then open python or ipython and type
"run romscice_nbc.py".
convert_era.job: A self-submitting batch job which converts 1 year of
ERA-Interim sub-daily data into a ROMS-CICE forcing file,
in chunks of 100 6-hour timesteps at once (otherwise the python
memory overflows because this is a LOT of data). Depends on
roms_cice_atm_subdaily.py.
To run: First edit user parameters in romscice_atm_subdaily.py
(see below). Then edit the PBS job settings at the top
of this file. Then, to get the batch jobs started for
a given year (say 1992), type
qsub -v YEAR=1992,COUNT=0 convert_era.job
You can also submit multiple years quickly with a bash
loop:
for i in `seq 1992 2005`;
do
qsub -v YEAR=$i,COUNT=0 convert_era.job
done
romscice_atm_subdaily.py: Convert 100 6-hour timesteps of an ERA-Interim
atmospheric forcing file (plus 50 12-hour timesteps
of ERA-Interim precipitation) to a ROMS-CICE forcing
file. Rotate the winds to local x-y space for ROMS
grid.
To run: Edit user parameters near the top of the
script (mainly just file paths). This script
is designed to be called by a self-submitting
batch job, e.g. convert_era.job.
romscice_atm_monthly.py: Convert ERA-Interim files of monthly averaged
atmospheric forcing to ROMS-CICE input forcing files
on the correct grid and with the correct units.
To run: Edit file paths near the top of the file and
start/end years near the bottom. Then open
python or ipython and type "run
romscice_atm_monthly.py".
romscice_nbc_rep.py: Given a ROMS lateral bounday condition file with one year
of monthly data, convert it to a file which can be used
repeatedly year after year (for eg spinup).
To run: Edit the user parameter (path to LBC file)
near the bottom of the file. Then open python or
ipython and type "run romscice_nbc_rep.py".
repeat_forcing.py: If you are spinning up ROMS-CICE-MCT using one repeating year
of daily- or sub-daily atmospheric forcing, the easiest
option is to have ROMS and CICE follow regular calendars
(1995, 1996, 1997, etc) and make 4 copies of this annually-
repeating file which the models will cycle through every
4 years. One of these years (depending on the start year)
must be a leap year. Once you have made four copies of the
one-year (non-leap-year) dataset, and named them with the
same naming convention (e.g. AN_yyyy_unlim.nc), this script
will 1) set the cycle_length attribute to 4 years in each
file; 2) alter the time axis of the latter 3 files so they
follow the first in sequence; and 3) interpolate data for
Feb 29th on the leap year, as the average of the Feb 28th and
March 1st records from the same time of day.
To run: Edit the user parameters near the bottom of the file
(paths to forcing files, years, variable names, etc)
then open python or ipython and type
"run repeat_forcing.py".
repeat_forcing_monthly.py: Same as repeat_forcing but for monthly forcing fields
rather than sub-daily. No interpolation is needed,
just modifying the time axis to put all data on the
15th of each month, with a cycle length of 4 years.
To run: Edit the user parameters near the bottom of
the file (paths to forcing files, years)
then open python or ipython and type
"run repeat_forcing_monthly.py".
romscice_nbc_zeta.py: Interpolate AVISO sea surface height climatology
(annual average) to the northern boundary of the ROMS
grid. Save to the existing lateral boundary condition
file, created using romscice_nbc.py.
To run: Edit file paths and boundary index near the top
of the file. Then make sure that you have scipy
version 0.14 or higher (on raijin, this means
switching to python/2.7.6; instructions at the
top of the file). Then open python or ipython
and type "run romscice_nbc_zeta.py". You will
be prompted for the path to the lateral
boundary condition file that you want to add
zeta to.
nbdry_grid_hack.py: Modify the ROMS grid so that the northernmost 15 rows
(about 3 degrees) have the same bathymetry, i.e. dh/dy=0,
on advice of Matt Mazloff.
To run: Open python or ipython and type
"run nbdry_grid_hack.py".
romscice_tides.py: Create a ROMS tide file containing the first 10 tidal
components interpolated from TPXO 7.2. (This is NOT the same
as Kate's potential tides option; it is for SSH_TIDES rather
than POT_TIDES.)
To run: Make sure the paths near the top of the file, to the
ROMS grid, TPXO 7.2 file, and desired output file,
are correct. Then make sure that you have scipy
version 0.14 or higher (on raijin, this means
switching to python/2.7.6; instructions at the top
of the file). Then open python or ipython and type
"run romscice_tides.py".
add_tide_period.py: Given a ROMS tide file with tidal potential amplitude and
phase angle (created using Kate's potential tide scripts),
add the tidal period in seconds for each component.
To run: First edit the variable "tide_file" to point to the
correct file to edit. Then open python or ipython
and type "run add_tide_period.py".
remove_cavities.py: Remove the ice shelf cavities from the given ROMS grid file
and fill them in with land. After you run this script, I
suggest you remove the variables "zice" and "mask_zice"
from the file using NCO, to avoid any confusion later.
To run: Open python or ipython and type
"run remove_cavities.py". You will be prompted for
the path to the ROMS grid file you wish to edit.
uvp_grid_fix.py: The Matlab scripts I use to generate the ROMS grid assume that
the u-grid, v-grid, and psi-grid points have the same locations
as the rho-grid, and they just chop off the last point in the
required dimension(s). This is not correct. This script fixes
that.
To run: Open python or ipython and type "run uvp_grid_fix.py".
You will be prompoted for the path to the ROMS grid
file you wish to edit.
iceberg_melt.py: Read Martin and Adcroft's monthly climatology of freshwater
fluxes from iceberg melt, interpolate to the ROMS grid, and
save as a forcing file.
To run: First make sure the paths to the input iceberg data
are correct. Then open python or ipython and type
"run iceberg_melt.py". The script will prompt you for
the filename of the output ROMS forcing file.
cice_ini.py: Make a CICE initial conditions file (non-standard option
ice_ic='mask') based on NSIDC satellite observations of sea ice
concentration. Wherever concentration exceeds 15%, set it to 100%;
everywhere else, set it to 0%. The CICE code will read this "mask"
and set a constant sea ice thickness of 1 m and snow thickness of
0.2 m.
To run: Make sure you have an NSIDC file containing the CDR monthly
average of sea ice concentration for the month you want.
Then open python or ipython and type "run cice_ini.py".
The script will prompt you for the path to the NSDIC file,
the ROMS grid file, and the desired output file.
paul_holland_hack.py: Paul Holland prevents spurious deep convection by applying
an extra 1500 Gt/y of freshwater flux spread evenly south
of 60S. Using the ROMS grid, calculate what the rate of
input should be in kg/m^2/s. Print the value to the
screen.
To run: Open python or ipython and type
"run paul_holland_hack.py". The script will prompt
you for the path to the ROMS grid file.
romscice_evap.py: Read one year of ERA-Interim evaporation data (12-hourly),
interpolate to the ROMS grid, and add to the existing FC
forcing file created using romscice_atm_subdaily.nc.
To run: Edit user parameters near the top of the script
(mainly just file paths). This script is designed to
be called by a self-submitting batch job, e.g.
era_evap.job.
era_evap.job: A self-submitting batch job which converts 1 year of ERA-Interim
evaporation 12-hourly data into an existing ROMS-CICE forcing file
(created using romscice_atm_subdaily.py) in chunks of 50 12-hour
timesteps at once (otherwise the python memory overflows because
this is a LOT of data). Depends on romscice_evap.py.
To run: First edit user parameters in romscice_evap.py (see
above). Then edit the PBS job settings at the top of this
file. Then, to get the batch jobs started for a given
year (say 1992, type
qsub -v YEAR=1992,COUNT=0 era_evap.job
You can also submit multiple years quickly with a bash
loop:
for i in `seq 1992 2005`;
do
qsub -v YEAR=$i,COUNT=0 era_evap.job
done
romscice_gpcp.py: Convert one year of GPCP monthly averages for total
precipitation to a ROMS-CICE input forcing file.
To run: First make sure the paths near the top of the script
(for the ROMS grid, GPCP input files, and desired
output files) are correct. Then open python or ipython
and type "run romscice_gpcp.py". The years 1992-2005
will be processed in a loop.
find_isolated_points.py: Find all of the CICE grid points which are land (or ice
shelf) on 3 sides. Sea ice can grow in these isolated
points but cannot escape due to CICE's coastal boundary
conditions, so it gets crazy thick (like 2 km thick).
Print the indices of these points to the screen. This
script assumes a periodic boundary in the longitude
direction
To run: Edit the variables start_j, end_j for the range
of j-indices you care about (i.e. could
possibly grow sea ice). Then open python or
ipython and type "run find_isolated_points.py".
The script will prompt you for the path to your
CICE land mask (kmt) file. Run cice_grid.py
if this file doesn't exist yet.
fix_isolated_points.py: Based on the results of find_isolated_points.py, fix
all the points which are isolated on 3 sides in the CICE
grid, by editing the ROMS grid. Set some of them to ice
shelf points (with zice the average of the correct
neighbour values), some to land points, remove the ice
shelves on others, and make other land points ocean
points (with h the average of the correct neighbour
values). After running this script, rerun cice_grid.py
to update the CICE grid. This script is grid-specific
and manually written. If you are editing it for a new
grid, make sure you take into account the ghost cells
in ROMS and CICE: point (i,j) in CICE is point (i+1,j+1)
in ROMS.
To run: Decide what you want to do for each point
flagged by find_isolated_points.py, and edit
this script accordingly. Make sure the path to
the ROMS grid file is correct. Then open python
or ipython and type "run fix_isolated_points.py"
romscice_sss_nudging.py: Interpolate the World Ocean Atlas 2013 monthly
climatology of sea surface salinity to the ROMS grid,
for use in surface salinity restoring.
To run: Make sure the paths to the ROMS grid file,
WOA input files, and desired output file
are correct (near the top of the file). Then
make sure that you have scipy version 0.14 or
higher (on raijin, this means switching to
python/2.7.6; instructions at the top of the
file). Then open python or ipython and type
"run romscice_sss_nudging.py".
romscice_flux_correction.py: Build a monthly climatology of the extra surface
salt flux due to surface salinity restoring in a
long ROMS run. Save as a NetCDF file that can be
used as a forcing file for another ROMS run
(option SSFLUX_EXTRA) with surface salinity
restoring off.
To run: First make sure you have concatenated the
ROMS averages files from the long
simulation into a single file, or at least
the ssflux_restoring variable. Then open
python or ipython and type
"run romscice_flux_correction.py". The
script will prompt you for the paths to
the concatenated ROMS averages file and
the desired output forcing file.
get_rms_tide_vel.m: Matlab script (the horror!) which calls the TMD/CATS2008a
tidal model:
https://www.esr.org/polar_tide_models/Model_CATS2008a.html
to get the RMS tidal velocity (sum of 10 constituents) for
each point on the ROMS grid. Outputs to a NetCDF file, which
can be used as a forcing file in MetROMS if you activate
ICESHELF_RMS_TIDES.
***POST-PROCESSING DIAGNOSTIC FILES***
make_density_file.py: Given an ocean history or averages file with temperature
and salinity data, calculate density fields at each
timestep using the 1980 UENSCO seawater equation of
state. Save in a new file.
To run: Open python or ipython, and type
"run make_density_file.py". The script will
prompt you for the paths to the ROMS grid file,
the ocean history or averages file, and the
desired path to the new density file.
common_grid.py: Interpolates ROMS output to a regular quarter-degree grid for
easy comparison with FESOM. Writes monthly averages of surface
heat and salt flux, the surface stress vector and its curl, and
the sea ice velocity vector.
To run: First concatenate your ROMS and CICE output into one
long file for each model, containing 5-day averages for
the entire simulation starting from 1 Jan. Then open
python or ipython and type "run common_grid.py". The
script will prompt you for the paths to the ROMS and
CICE output files, and the desired output file on the
common grid.
calc_rx1.py: Calculate the rx1 field (measure of grid steepness) for the given
grid and vertical stretching parameters. Save to a NetCDF file.
To run: Figure out what your vertical stretching parameters are
by looking at your *.in configuration file, or you can
just experiment based on other people's choices. Then
open python or ipython and type "run calc_rx1.py". The
script will prompt you for the paths to your ROMS grid
file and desired output file, as well as the vertical
stretching parameters. Note that this script assumes
Vtransform=2 (as do all scripts which call calc_z.py).
plot_layers.py: Plot the terrain-following vertical levels through a given
longitude, in a latitude vs. depth slice. This is a good way
to test out different choices for vertical stretching
parameters.
To run: Figure out what your vertical stretching parameters are
by looking at your *.in configuration file, or you can
just experiment based on other people's choices. Then
open python or ipython and type "run plot_layers.py".
The script will prompt you for the ROMS grid file, the
longitude to interpolate to, and your vertical
stretching parameters. The plot will be displayed on
screen, and the script will repeat as many times as you
like.
seasonal_climatology_roms.py: Calculate the seasonal climatology (DJF, MAM, JJA,
SON) of ocean temperature and salinity during a
ROMS simulation and save to a NetCDF file.
To run: First make sure your output is saved in
numbered ocean_avg_*.nc files containing
5-day averages. Then open python or
ipython and type
"run seasonal_climatology_roms.py". The
script will prompt you for the path to
the directory containing the ROMS output
files, the file indices to process
(eg ocean_avg_0001.nc to ocean_avg_0102.nc
means indices 1 to 102), and the path
to the desired output file.
seasonal_climatology_cice.py: Calculate the seasonal climatology (DJF, MAM, JJA,
SON) of sea ice concentration and thickness
during a CICE simulation and save to a NetCDF
file.
To run: First make sure your output is saved in
a single directory with the form
iceh.*.nc, each containing one 5-day
average, with no other files of that form
in that directory. Then open python or
ipython and type
"run seasonal_climatology_cice.py". The
script wil prompt you for the path to this
directory and to the desired output file.
***DIAGNOSTIC FIGURES***
plot_kinetic_energy.py: Extracts the kinetic energy values written in the
ocean.log files (you can supply as many ocean.log files
as you like, from e.g. a long run split into several
simulations) and plots the timeseries.
To run: Open python or ipython, and type "run
plot_kinetic_energy.py". The script will prompt
you for the paths to as many sequential
ocean.log files as you like, as well as the
timestep length and the output frequency for
ocean.log (INFOSTEP in Params.py if you are
using ROMS-CICE-MCT).
plot_maxspeed.py: Extracts the maximum velocity values written in the ocean.log
files (you can supply as many ocean.log files as you like,
from e.g. a long run split into several simulations) and plots
the timeseries.
To run: Open python or ipython, and type "run
plot_maxspeed.py". The script will prompt you for the
paths to as many sequential ocean.log files as you
like, as well as the timestep length and the output
frequency for ocean.log (INFOSTEP in Params.py if you
are using ROMS-CICE-MCT).
plot_volume.py: Extracts the volume values written in the ocean.log files (you
can supply as many ocean.log files as you like, from e.g. a
long run split into several simulations), converts them into
percent anomalies (with respect to the initial value), and
plots the timeseries.
To run: Open python or ipython, and type "run plot_volume.py".
The script will prompt you for the paths to as many
sequential ocean.log files as you like, as well as the
timestep length and the output frequency for ocean.log
(INFOSTEP in Params.py if you are using ROMS-CICE-MCT).
max_vel.py: Calculate the maximum |u| and |v| at each timestep of the given
ocean history (or averages) file, and plot the timeseries.
To run: Open python or ipython, and type "run max_vel.py". The
script will prompt you for the path to the ocean history
file.
avg_zeta.py: Calculate the area-averaged sea surface height at each timestep of
the given ocean history (or averages) file, and plot the
timeseries. This script also contains useful code for calculating
area averages.
To run: Open python or ipython, and type "run avg_zeta.py". The
script will prompt you for paths to the ocean history
and ROMS grid files.
timeseries_seaice.py: Calculates and plots timeseries of total sea ice area and
volume during a ROMS-CICE simulation. Also writes the
timeseries to a log file so they don't have to be
recomputed if the run is extended; at the beginning of
this script, previous values will be read from the same
log file if it exists.
To run: Open python or ipython and type
"run timeseries_seaice.py". The script will
prompt you for the paths to the CICE history file
and the log file.
timeseries_massloss.py: Calculates and plots timeseries of basal mass loss and
area-averaged melt rates from major ice shelves and the
entire continent during a ROMS simulation. Also writes
the timeseries to a log file so they don't have to be
recomputed if the run is extended; at the beginning of
this script, previous values will be read from the same
log file if it exists.
To run: Open python or ipython, and type
"run timeseries_massloss.py". The script will
prompt you for the paths to the ocean history
or averages file and the log file. If you are
using ice shelf draft data from something other
than RTopo 1.05 you might need to tweak the lat
and lon limits.
timeseries_dpt.py: Calculates and plots timeseries of Drake Passage transport
during a ROMS simulation. Also writes the timeseries to a
log file so it doesn't have to be recomputed if the run is
extended; at the beginning of this script, previous values
will be read from the same log file if it exists.
To run: Open python or ipython and type
"run timeseries_dpt.py". The script will prompt you
for the paths to the ROMS grid file, the ocean
history or averages file, and the log file.
timeseries_3D.py: Calculates and plots timeseries of total ocean heat content,
average salinity, and total kinetic energy during a ROMS
simulation. Also writes the timeseries to a log file so they
don't have to be recomputed if the run is extended; at the
beginning of this script, previous values will be read from
the same log file if it exists.
To run: Open python or ipython and type
"run timeseries_3D.py". The script will prompt you
for the paths to the ROMS grid file, the ocean history
or averages file, and the log file.
timeseries_sss.py: Calculates and plots timeseries of area-averaged sea surface
salinity, surface salt flux, and surface salt flux due to
salinity restoring during a ROMS simulation. Also writes the
timeseries to a log file so it doesn't have to be recomputed
if the run is extended; at the beginning of this script,
previous values will be read from the same log file if it
exists.
To run: Open python or ipython and type
"run timeseries_sss.py". The script will prompt you
for the path to the ROMS averages file and the log
file.
timeseries_i2osalt.py: Calculates and plots timeseries of area-averaged sea ice
to ocean salt flux during a ROMS simulation. Also writes
the timeseries to a log file so it doesn't have to be
recomputed if the run is extended; at the beginning of
this script, previous values will be read from the same
log file if it exists.
To run: Open python or ipython and type
"run timeseries_i2osalt.py". The script will
prompt you for the path to the CICE history file
and the log file.
aice_animation.py: Create an animation of sea ice concentration for the given
simulation, and save as an mp4 file.
To run: If you are on raijin, first type "module load ffmpeg"
to make sure you will be able to write the mp4 file.
Then edit the variables "directory", "num_ts", and
"start_file" near the top of the file to suit your
simulation. Then open python or ipython and type
"run aice_animation.py". Note that this isn't an
encapsulated function but rather just a script, so
be careful with existing variable names.
circumpolar_plot.py: Generates a circumpolar Antarctic plot of the given
variable from ROMS. If the variable is depth-dependent,
you can choose to plot the surface level, the bottom
level, a specific depth in metres, the vertical average
throughout the entire water column, or the vertical
average between two specified depths in metres.
To run: Open python or ipython and type
"run circumpolar_plot.py". The script will
prompt you for paths to the ROMS grid file,
the ocean history or averages file, the variable
name, the timestep to plot, what to do about
depth (if the variable is depth-dependent),
optional bounds on the colour scale, and whether
to save the figure in a file or display it on the
screen. When the plot is complete, the script will
ask if you want to make another, and if so, what
changes you want to make to the parameters (eg
variable name). It will repeat as many times as you
want. This way you don't have to re-enter all the
parameters again if only one or two of them have
changed.
circumpolar_cice_plot.py: Generates a circumpolar Antarctic plot of the given
variable from CICE.
To run: Open python or ipython and type
"run circumpolar_plot.py". The interface is
similar to that of circumpolar_plot.py, but
since sea ice variables are not
depth-dependent, there is no need to enter
depth information.
h_circumpolar.py: Creates a circumpolar Antarctic plot of bathymetry. Follows
the same process as circumpolar_plot.py, but since h is not
time-dependent, it requires a special case.
To run: Open python or ipython and type
"run h_circumpolar.py". The script will prompt you
for paths to the ROMS grid file and the filename
to save the figure as.
ice2ocn_fwflux.py: Creates a circumpolar Antarctic plot of net CICE-to-ROMS
freshwater flux in cm/day. Follows the same process as
circumpolar_cice_plot.py, but the derived variable
(FW flux - salt flux, converted to cm/day) requires a
special case.
To run: Open python or ipython and type
"run ice2ocn_fwflux.py". The script will prompt
you for the path to the CICE history file, the
timestep to plot, and the filename to save the
figure as.
ini_sst_circumpolar.py: Creates a circumpolar Antarctic plot of initial
SST from the ROMS initialisation file. Follows the
same process as circumpolar_plot.py, but since the
initialisation file is set up differently to the
ROMS history/averages files, it requires a special
case.
To run: Open python or ipython and type
"run ini_sst_circumpolar.py". The script
will prompt you for paths to the ROMS
grid file, the ROMS initialisation file,
and the filename to save the figure as.
ini_sss_circumpolar.py: Like ini_sst_circumpolar.py, but for initial SSS.
To run: Open python or ipython and type
"run ini_sss_circumpolar.py". The script
will prompt you for paths to the ROMS
grid file, the ROMS initialisation file,
and the filename to save the figure as.
zonal_plot.py: Creates a depth vs latitude plot of the given variable. You can
choose to plot a single longitude slice, a zonal average over
all longitudes, or a zonal average between two specific
longitudes.
To run: Edit grid parameters near the top of the file, and the
value of "dlon" (regular longitude spacing for your
grid) in the function average_btw_lons. Then open
python or ipython and type "run zonal_plot.py". The
script will prompt you for paths to the ROMS grid file
and the ocean history or averages file, the name of the
variable to plot, the timestep number to plot, the type
of plot (single longitude, zonally averaged over all
longitudes, or zonally averaged between two specific
longitudes), the deepst depth to plot, optional bounds on
the colour scale, and whether to save the file (and if
so, the filename) or display it on the screen. As with
circumpolar_plot.py and circumpolar_cice_plot.py, the
interface will repeat as many times as you like, and you
only have to specify which parameters have changed since
the last plot.
uv_vectorplot.py: Make a circumpolar Antarctic plot of speed overlaid with
velocity vectors at the given depth (surface, bottom, or
vertically aveaged).
To run: Open python or ipython and type
"run uv_vectorplot.py". You will be prompted for the
path to the ROMS history/averages file; the timestep;
whether to plot the surface, bottom, or vertically
averaged velocities; and whether to save the figure
(and if so, what filename to save it under) or display
it on the screen. As with the other interactive
plotting scripts, the interface will repeat as many
times as you like, and you only have to specify which
parameters have changed since the last plot.
massloss_map.py: Make a map of unexplained percent error in annually averaged
simulated basal mass loss from each ice shelf that is over
5,000 km^2 in Rignot et al., 2013.
To run: First make sure your logfile from
timeseries_massloss.py is up to date, as this script
reads simulated basal mass loss timeseries from this
logfile. Then open python or ipython and type
"run massloss_map.py". The script will prompt you for
paths to the ROMS grid file and the mass loss logfile,
and whether to save the figure (and if so, what
filename) or display it on the screen.
ismr_map.py: Same as massloss_map.py, but for area-averaged melt rates rather
than area-integrated mass loss.
To run: First make sure your logfile from timeseries_massloss.py
is up to date, as this script reads simulated basal mass
loss timeseries from this logfile. Then open python or
ipython and type "run ismr_map.py". The script will prompt
you for paths to the ROMS grid file and the mass loss
logfile, and whether to save the figure (and if so, what
filename) or display it on the screen.
nsidc_aice_monthly.py: Make a figure comparing sea ice concentration from NSIDC
(1995 data) and CICE (latest year of spinup under
repeated 1995 forcing), for the given month.
To run: First edit the variables nsidc_head,
nsidc_head_0, nsidc_head_1, and nsidc_tail (near
the top of the file) to suit the paths to NSIDC
output on your filesystem. Then open python or
ipython and type "run nsidc_aice_monthly.py". The
script will prompt you for the CICE output file,
the month to plot, and whether to save the figure
(and if so, what filename) or display it on the
screen. As with the other interactive plotting
scripts, the interface will repeat as many times
as you like, and you only have to specify which
parameters have changed since the last plot.
nsidc_aice_seasonal.py: Like nsidc_aice_monthly.py, but creates a 4x2 plot
comparing NSIDC and CICE sea ice concentration averaged
over each season (DJF, MAM, JJA, SON).
To run: First edit the variables nsidc_head,
nsidc_head_0, nsidc_head_1, and nsidc_tail (near
the top of the file) to suit the paths to NSIDC
output on your filesystem. Then open python or
ipython and type "run nsidc_aice_seasonal.py".
The script will prompt you for the CICE output
file and whether you want to save the figure
(and if so, what filename) or display it on the
screen. This script does not repeat.
ismr_plot.py: Creates a circumpolar plot of ice shelf melt rates averaged over
the last year of simulation.
To run: Open python or ipython and type "run ismr_plot.py". The
script will prompt you for the path to a ROMS output file
containing at least one year of 5-day averages, and
ask you whether you want to save the figure (and if so,
what filename) or display it on screen.
bwtemp_plot.py: Creates a circumpolar plot of bottom water temperature, averaged
over the last year of simulation.
To run: Open python or ipython and type "run bwtemp_plot.py".
The script will prompt you for the path to a ROMS
output file containing at least one year of 5-day
averages, and ask you whether you want to save the
figure (and if so, what filename) or display it on
screen.
bwsalt_plot.py: Creates a circumpolar plot of bottom water salinity, averaged
over the last year of simulation.
To run: Open python or ipython and type "run bwsalt_plot.py".
The script will prompt you for the path to a ROMS
output file containing at least one year of 5-day
averages, and ask you whether you want to save the
figure (and if so, what filename) or display it on
screen.
sose_roms_seasonal.py: Make a 4x2 plot compring lat vs. depth slices of
seasonally averaged temperature or salinity at the given
longitude, between ROMS (last year of simulation) and
SOSE (2005-2010 climatology).
To run: First make the sure the path to the SOSE seasonal
climatology file, stored in the variable
sose_file near the top of the main function, is
correct. (If you don't have this file ask Kaitlin
for it.) Then open python or ipython and type
"run sose_roms_seasonal.py". You will be prompted
for the path to the ROMS output file, whether to
plot temperature or salinity, the longitude
slice to plot, the deepest depth to plot, and
whether to save the figure (and if so, what
filename) or display it on screen. As with other
interactive plotting scripts, the interface will
repeat as many times as you want and only ask for
changes to the existing options.
zice_circumpolar.py: Creates a circumpolar Antarctic plot of ice shelf draft.
To run: Open python or ipython and type
"run zice_circumpolar.py". The script will prompt
you for the path to the ROMS grid file and the
filename to save the figure under.
grid_res.py: Make a circumpolar plot of the horizontal resolution of the ROMS
grid (square root of the area of each cell).
To run: Open python or ipython and type "run grid_res.py". You will
be prompted for the ROMS grid file, and whether to save the
figure (and if so, what filename) or display it on the
screen.
mld_plot.py: Create a circumpolar Antarctic plot of mixed layer depth in ROMS.
Follows the same process as circumpolar_plot.py, but masking out
the ice shelves requires a special case.
To run: Open python or ipython and type "mld_plot.py". You will
be prompted for the ROMS output file, the timestep to
plot, colour bounds (optional), whether to save the figure
(and if so, what filename) or display it on the screen.
This script is non-repeating.
make_zonal_slices.sh: Example of a bash script that calls sose_roms_seasonal.py
for both temperature and salinity at 10 degree increments
all along the Antarctic coastline.
To run: First edit the variable ROMS_FILE to point to the
ROMS output file you want plots for (it must
contain at least 1 year of 5-day averages).
Also change whatever other arguments you want
in the calls to sose_roms_seasonal, such as the
output file name or the maximum depth to plot.
Then just type "./make_zonal_slices.sh" in the
shell and it will go.
aice_hi_seasonal.py: Creates a 4x2 plot of seasonally averaged sea ice
concentration (top row) and thickness (bottom row) over
the last year of simulation.
To run: Open python or ipython and type
"run aice_hi_seasonal.py". The script will prompt
you for the CICE output file and whether you want
to save the figure (and if so, what filename) or
display it on the screen. This script does not
repeat.
freezingpt_slice.py: Plot the difference from the freezing temperature for a
single i-slice (depth versus y) with no time-averaging,
spatial averaging, or interpolation. This helps to show
where there is spurious supercooling.
To run: Open python or ipython and type
"run freezingpt_slice.py". The script will prompt
you for the path to the ROMS history file, the
timestep and i-index to plot, the deepest depth
to plot, optional bounds on the colour scale,
and if you want to save the figure (and if so,
what filename) or display it on the screen. This
script repeats as many times as you like.
i_slice.py: Plot the given variable for a single i-slice (depth versus y) with
no time-averaging, spatial averaging, interpolation, or velocity
rotation. This helps to show where there are advective errors.
To run: Open python or ipython and type "run i_slice.py". The
script will prompt you for the path to the ROMS history
file, the variable name, the timestep and i-index to plot,
the deepest depth to plot, optional bounds on the colour
scale, and if you want to save the figure (and if so, what
filename) or display it on the screen. This script repeats
as many times as you like.
cice_vectorplot.py: For any vector in the CICE output (velocities, stresses,
etc.) make a circumpolar Antarctic plot of its magnitude,
overlaid with the vectors themselves.
To run: Open python or ipython and type
"run cice_vectorplot.py". The script will prompt you
for the path to the CICE history file, the timestep
to plot, the names of the vector components,
optional bounds on the colour scale for magnitude,
and if you want to save the figure (and if so, what
filename) or display it on the screen. This script
repeats as many times as you like.
effective_thickness.py: Make a circumpolar plot of effective sea ice thickness
(area*height).
To run: Open python or ipython and type
"run effective_thickness.py". The script will
prompt you for the path to the CICE history
file, the timestep to plot, optional bounds on
the colour scale, and if you want to save the
figure (and if so, what filename) or display it
on the screen. This script repeats as many
times as you like.
temp_salt_seasonal.py: Make a 4x2 plot showing lat vs. depth slides of
seasonally averaged temperature (top) and salinity
(bottom) at the given longitude, over the last year of
simulation.
To run: Open python or ipython and type
"run temp_salt_seasonal.py". The script will
prompt you for paths to the ROMS output file,
the longitude to plot, the deepest depth to
plot, and whether you want to save the figure
(and if so, what filename) or display it on
the screen. This script repeats as many times
as you like.
ssflux_tamura_monthly.py: Make a figure comparing monthly-averaged sea ice
to ocean salt fluxes, from Tamura's dataset to CICE
output.
To run: First make sure the paths to monthly-averaged,
unit-corrected (to kg/m^2/s) Tamura data files
are correct. Then open python or ipython and
type "run ssflux_tamura_monthly.py". The
script will prompt you for paths to the CICE
output file, the month, and whether you want
to save the figure (and if so, what filename)
or display it on the screen. This script
repeats as many times as you like.
ssflux_tamura_seasonal.py: Make a figure comparing seasonally-averaged sea ice
to ocean salt fluxes, from Tamura's dataset to CICE
output.
To run: First make sure the paths to
monthly-averaged, unit-corrected (to
kg/m^2/s) Tamura data files are correct. Then
open python or iptyhon and type
"run ssflux_tamura_seasonal.py". The script
will prompt you for paths to the CICE output
file and whether you want to save the figure
(and if so, what filename) or display it on
the screen. This script is non-repeating.
ssflux_tamura_annual.py: Make a figure comparing annually-averaged sea ice to
ocean salt fluxes, from Tamura's dataset to CICE
output.
To run: First make sure the paths to monthly-averaged,
unit-corrected (to kg/m^2/s) Tamura data files
are correct. Then make sure you have an
annually averaged CICE file. Then open python
or ipython and type
"run ssflux_tamura_annual.py". The script will
prompt you for the path to this CICE file, the
year it corresponds to, and whether you want
to save the figure (and if so, what filename)
or display it on the screen. This script
is non-repeating.
sose_seasonal.py: Make a 4x2 plot showing lat vs. depth slices of seasonally
averaged temperature (top) and salinity (bottom) at the given
longitude, for the 2005-2010 SOSE climatology.
To run: First make sure the path to the SOSE seasonal
climatology file is correct (if you don't have this
file, ask Kaitlin). Then open python or ipython and
type "run sose_seasonal.py". The script will
prompt you for the longitude to interpolate to, the
deepest depth to plot, and whether to save the
figure (and if so, what filename) or display it on
the screen. This script is non-repeating.
ice_drift_seasonal.py: Create a 2x2 plot replicating Figure 1 of Holland &
Kimura 2016, showing sea ice velocity vectors overlaying
sea ice concentration for the seasonal averages FMA, MMJ,
ASO, NDJ.
To run: Open python or ipython and type
"run ice_drift_seasonal.py". The script will
prompt you for the path to a CICE output file
containing 5-day averages for at least one
complete Feb-Jan period. It will also ask whether
you want to save the figure (and if so, what
filename) or display it on the screen. This
script is non-repeating.
seaice_budget.py: Create four plots showing timeseries of the thermodynamic vs
dynamic volume tendency, averaged over (1) the continental
shelf (defined as anywhere south of 60S with seafloor
shallower than 1500 m), and (2) the offshore region
(everywhere else). Two plots are the absolute volume
tendencies (units of cm/day), the other two are cumulative
over the simulation (cm).
To run: Open python or ipython and type
"run seaice_budget.py." The script will prompt you for
the path to the CICE output file, the path to the ROMS
grid file, and whether you want to save the figures
(and if so, what filenames) or display them on the
screen.
seaice_budget_thermo.py: Create four plots showing timeseries of the
thermodynamic terms of sea ice growth and melt:
congelation, frazil ice formation, snow-to-ice
flooding, top melt, basal melt, and lateral melt.
These variables are averaged over (1) the continental
shelf (defined as anywhere south of 60S with seafloor
shallower than 1500 m), and (2) the offshore region
(everywhere else). Two plots are the absolute volume
tendencies (units of cm/day), the other two are
cumulative over the simulation (cm).
To run: Open python or ipython and type
"run seaice_budget_thermo.py". The script will
prompt you for the path to the CICE output
file, the path to the ROMS grid file, and
whether you want to save the figures (and if
so, what filenames) or display them on the
screen.
compare_nic_seasonal.py: Make a 4x2 plot comparing seasonal averages of the
given variable from my implementation of CICE in
MetROMS (bottom) and Nic Hannah's implementation
coupled to MOM (top).
To run: Open python or ipython and type
"run compare_nic_seasonal.py". The script will
prompt you for the path to the CICE-MetROMS
output file, the variable name to plot,
optional colour bounds, and whether you want
to save the figure (and if so, what filename)
or display it on the screen. The script will
repeat as many times as you like.
era_gpcp.py: Plot precipitation (1992-2005 average) in the ERA-Interim versus
GPCP datasets over the Southern Ocean.
To run: First make sure the ERA-Interim and GPCP paths near the top
of the file are correct. Then open python or ipython and
type "run era_gpcp.py". The figure will be saved under
the filename "era_gpcp.png".
evap_era_monthly.py: Plot monthly-averaged evaporation as calculated by MetROMS
(ROMS and CICE calculate separately, so merge them based
on sea ice concentration) and compare it to ERA-Interim.
To run: First make sure the ERA-Interim paths near the top
of the file are correct. Then open python or
ipython and type "run evap_era_monthly.py". The
script will prompt you for paths to the ROMS and
CICE output files (5-day averages for the same
timesteps; if multiple instances of the given month
are present the script will select the last one),
the month to plot, optional colour bounds, and
whether you want to save the figure (and if so,
what filename) or display it on the screen. The
script will repeat as many times as you like.
holland_fig1.py: Recreate Figure 1 of Holland et al 2014
(doi:10.1175/JCLI-D-13-00301.1) using ROMS output: annually
averaged barotropic streamfunction, JJA mean mixed-layer depth
(just plot the KPP boundary layer depth for now), annually
averaged bottom water temperature and salinity.
To run: Open python or ipython and type "run holland_fig1.py".
The script will prompt you for the path to the ROMS
grid file, and the ROMS output file containing exactly
1 year of 5-day averages including a continuous
June-August period. The figure will be displayed on
the screen.
temp_salt_slice.py: Create a 2x1 plot showing zonal slices (depth vs latitude)
of temperature and salinity interpolated to the given
longitude, at the given timestep.
To run: Open python or ipython and type
"run temp_salt_slice.py". The script will prompt you
for the path to the ROMS averages file, the timestep
to plot, the longitude to interpolate to, the
deepest depth to plot, and whether you want to save
the figure (and if so, what filename) or display it
on the screen. This script repeats as many times
as you want.
timeseries_seaice_extent.py: Calculate and plot timeseries of sea ice extent
(area of ice with concentration >= 15%) during a
ROMS-CICE simulation.
To run: Open python or ipython and type
"run timeseries_seaice_extent.py". The
script will prompt you for the paths to
the CICE history file and the log file.
timeseries_massloss_depth.py: Plot timeseries of total basal mass loss and
area-averaged ice shelf melt rates split up into
3 different depth classes for the ice shelf draft.
To run: Open python or ipython, and type
"run timeseries_massloss_depth.py". The
script will prompt you for the paths to
the ocean history or averages file and
the log file.