-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathio_meandata.F90
More file actions
3110 lines (2786 loc) · 189 KB
/
io_meandata.F90
File metadata and controls
3110 lines (2786 loc) · 189 KB
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
module io_MEANDATA
USE MOD_PARTIT
USE MOD_PARSUP
#if defined(__recom)
use recom_glovar
use recom_config
use recom_ciso
#endif
USE g_clock
use o_PARAM, only : WP
use, intrinsic :: iso_fortran_env, only: real64, real32
use io_data_strategy_module
use async_threads_module
use netcdf
implicit none
private
public :: def_stream, def_stream2D, def_stream3D, def_stream0D, output, finalize_output
!
!--------------------------------------------------------------------------------------------
!
integer, parameter :: i_real8=8, i_real4=4
! NetCDF standard fill values for missing/invalid data
real(real32), parameter :: NC_FILL_FLOAT = 9.9692099683868690e+36_real32
real(real64), parameter :: NC_FILL_DOUBLE = 9.9692099683868690e+36_real64
type Meandata
private
type(t_partit), pointer :: p_partit
integer :: ndim
integer :: glsize(2)
integer :: shrinked_size
integer, allocatable, dimension(:) :: shrinked_indx
integer :: accuracy
real(real64), allocatable, dimension(:,:) :: local_values_r8
real(real32), allocatable, dimension(:,:) :: local_values_r4
real(real64), allocatable :: aux_r8(:)
real(real32), allocatable :: aux_r4(:)
integer :: addcounter =0
integer :: lastcounter=0 ! before addcounter is set to 0
real(kind=WP), pointer :: ptr3(:,:) ! todo: use netcdf types, not WP
character(500) :: filename
character(100) :: name
character(500) :: description
character(100) :: units
character(100) :: dimname(2)
integer :: ncid
integer :: rec_count=0
integer :: recID, tID
integer :: dimID(2), dimvarID(2), varID
integer :: freq=1
character :: freq_unit='m'
logical :: is_in_use=.false.
logical :: is_elem_based = .false.
logical :: flip
class(data_strategy_type), allocatable :: data_strategy
integer :: comm
type(thread_type) thread
integer :: root_rank = 0
logical :: thread_running = .false.
real(real64), allocatable, dimension(:,:) :: local_values_r8_copy
real(real32), allocatable, dimension(:,:) :: local_values_r4_copy
real(kind=WP) :: ctime_copy
integer :: mype_workaround
character(500) :: long_description=""
character(100) :: defined_on=""
character(100) :: mesh="fesom_mesh"
! to be passed to MULTIO (time window for the accumulations)
integer :: currentDate, currentTime
integer :: previousDate, previousTime
integer :: startDate, startTime
contains
final destructor
end type Meandata
!
!--------------------------------------------------------------------------------------------
!
type(Meandata), save, target :: io_stream(150) ! todo: find a way to increase the array withhout move_alloc to keep the derived types in Meandata intact
integer, save :: io_NSTREAMS=0
real(kind=WP) :: ctime !current time in seconds from the beginning of the year
!
!--------------------------------------------------------------------------------------------
!
integer, save :: io_listsize =0
logical, save :: vec_autorotate=.FALSE.
logical, save :: lnextGEMS =.FALSE.
integer, save :: nlev_upper=1
character(len=1), save :: filesplit_freq='y'
integer, save :: compression_level=0
type io_entry
CHARACTER(len=15) :: id ='unknown '
INTEGER :: freq =0
CHARACTER :: unit =''
INTEGER :: precision =0
end type io_entry
type(io_entry), save, allocatable, target :: io_list(:)
!
!--------------------------------------------------------------------------------------------
! Type for 0D (scalar) output streams - global values with time dimension only
type Meandata0D
character(100) :: name
character(500) :: description
character(100) :: units
character(500) :: long_description=""
real(kind=WP), pointer :: ptr ! pointer to scalar value
real(real64) :: local_value ! accumulated value
integer :: addcounter = 0
integer :: accuracy
integer :: freq = 1
character :: freq_unit = 'm'
logical :: is_in_use = .false.
! NetCDF handles
integer :: ncid = -1
integer :: varid, timeid, timedimid
integer :: rec_count = 0
character(500) :: filename = "" ! current output file path
end type Meandata0D
type(Meandata0D), save, target :: io_stream0D(50)
integer, save :: io_NSTREAMS0D = 0
!
!--------------------------------------------------------------------------------------------
! generic interface was required to associate variables of unknown rank with the pointers of the same rank
! this allows for automatic streaming of associated variables into the netcdf file
INTERFACE def_stream
MODULE PROCEDURE def_stream2D, def_stream3D
END INTERFACE
!
!--------------------------------------------------------------------------------------------
REAL(real64), DIMENSION(:), ALLOCATABLE, TARGET :: multio_temporary_array
contains
!
!--------------------------------------------------------------------------------------------
!
!
!
!_______________________________________________________________________________
! not sure why this is needed --> seems to become method of meandata stream object
! type Meandata
! private
! ...
! contains
! final destructor
! end type
subroutine destructor(this)
type(Meandata), intent(inout) :: this
! EO args
call assert_nf(nf90_close(this%ncid), __LINE__)
end subroutine destructor
!
!
!_______________________________________________________________________________
! define 2d/3d meandata stream parameter
subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh)
!------------------------------------------
! LA 2023-01-31 add iceberg params
use iceberg_params
!------------------------------------------
use MOD_MESH
use MOD_TRACER
use MOD_PARTIT
use MOD_PARSUP
use MOD_DYN
use MOD_ICE
use o_ARRAYS
use o_mixing_KPP_mod
use g_backscatter
use diagnostics
use cmor_variables_diag
use g_forcing_arrays
#if defined (__cvmix)
use g_cvmix_tke
use g_cvmix_idemix
use g_cvmix_kpp
use g_cvmix_tidal
#endif
#if defined(__recom)
use recom_glovar
use recom_config
use recom_ciso
#endif
use g_forcing_param, only: use_virt_salt, use_landice_water, use_age_tracer !---fwf-code, age-code
use g_config, only : use_cavity, lwiso !---wiso-code
use mod_transit, only : index_transit_r14c, index_transit_r39ar, index_transit_f11, index_transit_f12, index_transit_sf6
implicit none
integer :: i, j
integer, save :: nm_io_unit = 103 ! unit to open namelist file, skip 100-102 for cray
integer :: iost
integer,dimension(15) :: sel_forcvar=0
integer :: sel_dmoc=0, sel_trgrd_xyz=0, sel_dvd=0, sel_redi=0
character(len=10) :: id_string
type(t_mesh), intent(in) , target :: mesh
type(t_partit), intent(inout), target :: partit
type(t_tracer), intent(in) , target :: tracers
type(t_dyn) , intent(in) , target :: dynamics
type(t_ice) , intent(in) , target :: ice
namelist /nml_general / io_listsize, vec_autorotate, lnextGEMS, nlev_upper, filesplit_freq, compression_level
namelist /nml_list / io_list
#include "associate_part_def.h"
#include "associate_mesh_def.h"
#include "associate_part_ass.h"
#include "associate_mesh_ass.h"
!___________________________________________________________________________
! OPEN and read namelist for I/O
open( unit=nm_io_unit, file='namelist.io', form='formatted', access='sequential', status='old', iostat=iost )
if (iost == 0) then
if (mype==0) WRITE(*,*) ' file : ', 'namelist.io',' open ok'
else
if (mype==0) WRITE(*,*) 'ERROR: --> file not found : ', 'namelist.io',' ; iostat=',iost
call par_ex(partit%MPI_COMM_FESOM, partit%mype, 1)
stop
endif
READ(nm_io_unit, nml=nml_general, iostat=iost )
if (iost/=0) then
if (mype==0) WRITE(*,*) 'ERROR: in reading nml_general block in namelist.io, invalid formatting.'
call par_ex(partit%MPI_COMM_FESOM, partit%mype, 1)
endif
allocate(io_list(io_listsize))
READ(nm_io_unit, nml=nml_list, iostat=iost )
close(nm_io_unit )
!___________________________________________________________________________
! TODO: unknown variable found then write clearly in log, saves lot of frustration.
do i=1, io_listsize
if (trim(io_list(i)%id)=='unknown ') then
if (mype==0) write(*,*) 'io_listsize will be changed from ', io_listsize, ' to ', i-1, '!'
io_listsize=i-1
EXIT
end if
end do
!_______________________________________________________________________________
DO i=1, io_listsize
SELECT CASE (trim(io_list(i)%id))
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2D streams!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CASE ('sst ')
call def_stream(nod2D, myDim_nod2D, 'sst', 'sea surface temperature', 'C', tracers%data(1)%values(1,1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Sea surface temperature")
CASE ('sss ')
call def_stream(nod2D, myDim_nod2D, 'sss', 'sea surface salinity', 'psu', tracers%data(2)%values(1,1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Sea surface salinity")
CASE ('ssh ')
call def_stream(nod2D, myDim_nod2D, 'ssh', 'sea surface elevation', 'm', dynamics%eta_n, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('vve_5 ')
call def_stream(nod2D, myDim_nod2D, 'vve_5', 'vertical velocity at 5th level', 'm/s', dynamics%w(5,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('t_star ')
call def_stream(nod2D, myDim_nod2D,'t_star' , 'air temperature' , 'C' , t_star(:) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('qsr ')
call def_stream(nod2D, myDim_nod2D,'qsr' , 'solar radiation' , 'W/s^2' , qsr_c(:) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
! CMOR diagnostics for CMIP6/CMIP7 (require ldiag_cmor=.true.)
CASE ('tos ')
if (ldiag_cmor) then
call def_stream(nod2D, myDim_nod2D, 'tos', 'sea surface temperature', 'degC', tos(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Sea surface temperature (CMOR)")
end if
CASE ('sos ')
if (ldiag_cmor) then
call def_stream(nod2D, myDim_nod2D, 'sos', 'sea surface salinity', 'psu', sos(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Sea surface salinity (CMOR)")
end if
CASE ('pbo ')
if (ldiag_cmor) then
call def_stream(nod2D, myDim_nod2D, 'pbo', 'sea water pressure at sea floor', 'Pa', pbo(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Sea water pressure at sea floor")
end if
CASE ('opottemptend')
if (ldiag_cmor) then
call def_stream(nod2D, myDim_nod2D, 'opottemptend', 'tendency of sea water potential temperature', 'W/m2', opottemptend(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh, "Tendency of sea water potential temperature expressed as heat content")
end if
! CMOR 0D (scalar) diagnostics for CMIP6/CMIP7 (require ldiag_cmor=.true.)
CASE ('volo ')
if (ldiag_cmor) then
call def_stream0D('volo', 'sea water volume', 'm3', volo, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total volume of liquid sea water")
end if
CASE ('soga ')
if (ldiag_cmor) then
call def_stream0D('soga', 'global mean sea water salinity', 'psu', soga, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Global mean sea water salinity")
end if
CASE ('thetaoga ')
if (ldiag_cmor) then
call def_stream0D('thetaoga', 'global mean sea water potential temperature', 'degC', thetaoga, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Global mean sea water potential temperature")
end if
CASE ('siarean ')
if (ldiag_cmor) then
call def_stream0D('siarean', 'sea ice area northern hemisphere', '1e12 m2', siarean, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total area of sea ice in the Northern hemisphere")
end if
CASE ('siareas ')
if (ldiag_cmor) then
call def_stream0D('siareas', 'sea ice area southern hemisphere', '1e12 m2', siareas, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total area of sea ice in the Southern hemisphere")
end if
CASE ('siextentn ')
if (ldiag_cmor) then
call def_stream0D('siextentn', 'sea ice extent northern hemisphere', '1e12 m2', siextentn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total area of sea ice extent in the Northern hemisphere")
end if
CASE ('siextents ')
if (ldiag_cmor) then
call def_stream0D('siextents', 'sea ice extent southern hemisphere', '1e12 m2', siextents, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total area of sea ice extent in the Southern hemisphere")
end if
CASE ('sivoln ')
if (ldiag_cmor) then
call def_stream0D('sivoln', 'sea ice volume northern hemisphere', '1e9 m3', sivoln, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total volume of sea ice in the Northern hemisphere")
end if
CASE ('sivols ')
if (ldiag_cmor) then
call def_stream0D('sivols', 'sea ice volume southern hemisphere', '1e9 m3', sivols, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, "Total volume of sea ice in the Southern hemisphere")
end if
! 2d ssh diagnostic variables
CASE ('ssh_rhs ')
call def_stream(nod2D, myDim_nod2D, 'ssh_rhs' , 'ssh rhs' , 'm/s', dynamics%ssh_rhs , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('ssh_rhs_old')
call def_stream(nod2D, myDim_nod2D, 'ssh_rhs_old', 'ssh rhs' , 'm/s', dynamics%ssh_rhs_old, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('d_eta ')
call def_stream(nod2D, myDim_nod2D, 'd_eta' , 'dssh (from solver)', 'm' , dynamics%d_eta , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('hbar ')
call def_stream(nod2D, myDim_nod2D, 'hbar' , 'ssh n+0.5 tstep' , 'm' , mesh%hbar , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('hbar_old ')
call def_stream(nod2D, myDim_nod2D, 'hbar_old' , 'ssh n-0.5 tstep' , 'm' , mesh%hbar_old , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('dhe ')
call def_stream(elem2D, myDim_elem2D,'dhe' , 'dhbar @ elem' , 'm' , mesh%dhe , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
!___________________________________________________________________________________________________________________________________
! output sea ice
CASE ('uice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'uice', 'ice velocity x', 'm/s', ice%uice(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('vice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'vice', 'ice velocity y', 'm/s', ice%vice(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('a_ice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'a_ice', 'ice concentration', 'fraction', ice%data(1)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('m_ice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'm_ice', 'ice height per unit area', 'm', ice%data(2)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
! ice thermodynamic growth rate: ice, snow, area
CASE ('thdgrice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'thdgrice' , 'thermodynamic growth rate ice', 'm/s', ice%thermo%thdgr(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('thdgrsnw ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'thdgrsnw' , 'thermodynamic growth rate snow', 'm/s', ice%thermo%thdgrsn(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('thdgrarea ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'thdgrarea', 'thermodynamic growth rate ice concentration', 'frac/s', ice%thermo%thdgra(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
! ice dynamic growth rate: ice, snow, area
CASE ('dyngrice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'dyngrice' , 'dynamic growth rate ice', 'm/s', ice%thermo%dyngr(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('dyngrsnw ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'dyngrsnw' , 'dynamic growth rate snow', 'm/s', ice%thermo%dyngrsn(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('dyngrarea ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'dyngrarea', 'dynamic growth rate ice concentration', 'frac/s', ice%thermo%dyngra(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('flice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'flice', 'flooding growth rate ice', 'm/s', flice(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('m_snow ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'm_snow', 'snow height per unit area', 'm', ice%data(3)%values(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('h_ice ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'h_ice', 'ice thickness over ice-covered fraction', 'm', ice%h_ice(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('h_snow ')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'h_snow', 'snow thickness over ice-covered fraction', 'm', ice%h_snow(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
! Melt pond variables
CASE ('apnd ')
if (use_ice .and. ice%thermo%use_meltponds) then
call def_stream(nod2D, myDim_nod2D, 'apnd', 'melt pond area fraction', 'frac', ice%thermo%apnd(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('hpnd ')
if (use_ice .and. ice%thermo%use_meltponds) then
call def_stream(nod2D, myDim_nod2D, 'hpnd', 'melt pond depth', 'm', ice%thermo%hpnd(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('ipnd ')
if (use_ice .and. ice%thermo%use_meltponds) then
call def_stream(nod2D, myDim_nod2D, 'ipnd', 'melt pond ice lid thickness', 'm', ice%thermo%ipnd(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
! Debug ice variables
CASE ('strength_ice')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'strength_ice', 'ice strength', '?', ice%work%ice_strength(1:myDim_elem2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('inv_areamass')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'inv_areamass', 'inv_areamass', '?', ice%work%inv_areamass(1:myDim_nod2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('rhs_a')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'rhs_a' , 'rhs_a' , '?', ice%data(1)%values_rhs(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('rhs_m')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D, 'rhs_m' , 'rhs_m' , '?', ice%data(2)%values_rhs(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('sgm11')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'sgm11' , 'sgm11' , '?', ice%work%sigma11(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('sgm12')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'sgm12' , 'sgm12' , '?', ice%work%sigma12(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('sgm22')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'sgm22' , 'sgm22' , '?', ice%work%sigma22(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('eps11')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'eps11' , 'eps11' , '?', ice%work%eps11(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('eps12')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'eps12' , 'eps12' , '?', ice%work%eps12(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('eps22')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'eps22' , 'eps22' , '?', ice%work%eps22(1:myDim_elem2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('u_rhs_ice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'u_rhs_ice', 'u_rhs_ice', '?', ice%uice_rhs(1:myDim_nod2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('v_rhs_ice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'v_rhs_ice', 'v_rhs_ice', '?', ice%vice_rhs(1:myDim_nod2D) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('metric_fac')
if (use_ice) then
call def_stream(elem2D, myDim_elem2D, 'metric_fac', 'metric_fac', '?', mesh%metric_factor(1:myDim_elem2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('elevat_ice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'elevat_ice', 'elevat_ice', '?', ice%srfoce_ssh(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('uwice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'uwice' , 'uwice' , '?', ice%srfoce_u(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('vwice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'vwice', 'vwice', '?', ice%srfoce_v(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('twice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'twice', 'twice', '?', ice%srfoce_temp(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('swice')
if (use_ice) then
call def_stream(nod2D, myDim_nod2D , 'swice', 'swice', '?', ice%srfoce_salt(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
!_______________________________________________________________________________
! output mixed layer depth
CASE ('MLD1 ')
call def_stream(nod2D, myDim_nod2D, 'MLD1', 'Mixed Layer Depth', 'm', MLD1(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('MLD2 ')
call def_stream(nod2D, myDim_nod2D, 'MLD2', 'Mixed Layer Depth', 'm', MLD2(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('MLD3 ')
call def_stream(nod2D, myDim_nod2D, 'MLD3', 'Mixed Layer Depth', 'm', MLD3(1:myDim_nod2D), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
!_______________________________________________________________________________
! output heat content (for destine)
CASE ('hc300m')
if (ldiag_destine) then
call def_stream(nod2D, myDim_nod2D, 'hc300m', 'Vertically integrated heat content upper 300m', 'J m**-2', heatcontent(1:myDim_nod2D,1), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('hc700m')
if (ldiag_destine) then
call def_stream(nod2D, myDim_nod2D, 'hc700m', 'Vertically integrated heat content upper 700m', 'J m**-2', heatcontent(1:myDim_nod2D,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('hc')
if (ldiag_destine) then
call def_stream(nod2D, myDim_nod2D, 'hc', 'Vertically integrated heat content total column', 'J m**-2', heatcontent(1:myDim_nod2D,3), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
!_______________________________________________________________________________
!---wiso-code
! output water isotopes in sea ice
CASE ('h2o18_ice ')
if (lwiso) then
call def_stream(nod2D, myDim_nod2D, 'h2o18_ice', 'h2o18 concentration in sea ice', 'kmol/m**3', tr_arr_ice(:,1), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('hDo16_ice ')
if (lwiso) then
call def_stream(nod2D, myDim_nod2D, 'hDo16_ice', 'hDo16 concentration in sea ice', 'kmol/m**3', tr_arr_ice(:,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('h2o16_ice ')
if (lwiso) then
call def_stream(nod2D, myDim_nod2D, 'h2o16_ice', 'h2o16 concentration in sea ice', 'kmol/m**3', tr_arr_ice(:,3), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
!---wiso-code-end
!---fwf-code-begin
CASE ('landice ')
if (use_landice_water) then
call def_stream(nod2D, myDim_nod2D, 'landice', 'freshwater flux', 'm/s', runoff_landice, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
!---fwf-code-end
!---age-code-begin
CASE ('age ')
if (use_age_tracer) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'age', 'water age tracer', 'year', tracers%data(index_age_tracer)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
!---age-code-end
!_______________________________________________________________________________
! output surface forcing
CASE ('fh ')
call def_stream(nod2D, myDim_nod2D, 'fh' , 'heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_sen ')
call def_stream(nod2D, myDim_nod2D, 'fh_sen' , 'sensible heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_lat ')
call def_stream(nod2D, myDim_nod2D, 'fh_lat' , 'latent heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_radtot ')
call def_stream(nod2D, myDim_nod2D, 'fh_radtot', 'total radiation heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_swr ')
call def_stream(nod2D, myDim_nod2D, 'fh_swr' , 'shortwave radiation heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_lwr ')
call def_stream(nod2D, myDim_nod2D, 'fh_lwr' , 'longwave radiation heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fh_lwrout ')
call def_stream(nod2D, myDim_nod2D, 'fh_lwrout', 'outgoing longwave radiation heat flux', 'W/m2', heat_flux_in(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fw ')
call def_stream(nod2D, myDim_nod2D, 'fw' , 'fresh water flux', 'm/s', water_flux(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fw_ice ')
call def_stream(nod2D, myDim_nod2D, 'fw_ice' , 'fresh water flux from ice', 'm/s', fw_ice(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('fw_snw ')
call def_stream(nod2D, myDim_nod2D, 'fw_snw' , 'fresh water flux from snow', 'm/s', fw_snw(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('atmice_x ')
call def_stream(nod2D, myDim_nod2D, 'atmice_x', 'stress atmice x', 'N/m2', ice%stress_atmice_x(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('atmice_y ')
call def_stream(nod2D, myDim_nod2D, 'atmice_y', 'stress atmice y', 'N/m2', ice%stress_atmice_y(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('atmoce_x ')
call def_stream(nod2D, myDim_nod2D, 'atmoce_x', 'stress atmoce x', 'N/m2', stress_atmoce_x(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('atmoce_y ')
call def_stream(nod2D, myDim_nod2D, 'atmoce_y', 'stress atmoce y', 'N/m2', stress_atmoce_y(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('iceoce_x ')
call def_stream(nod2D, myDim_nod2D, 'iceoce_x', 'stress iceoce x', 'N/m2', ice%stress_iceoce_x(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('iceoce_y ')
call def_stream(nod2D, myDim_nod2D, 'iceoce_y', 'stress iceoce y', 'N/m2', ice%stress_iceoce_y(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('alpha ')
call def_stream(nod2D, myDim_nod2D, 'alpha', 'thermal expansion', 'none', sw_alpha(1,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('beta ')
call def_stream(nod2D, myDim_nod2D, 'beta', 'saline contraction', 'none', sw_beta (1,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('dens_flux ')
call def_stream(nod2D, myDim_nod2D, 'dflux', 'density flux', 'kg/(m3*s)', dens_flux(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('runoff ')
sel_forcvar(10)= 1
call def_stream(nod2D, myDim_nod2D, 'runoff', 'river runoff', 'm/s', runoff(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('evap ')
sel_forcvar(7) = 1
call def_stream(nod2D, myDim_nod2D, 'evap', 'evaporation', 'm/s', evaporation(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('prec ')
sel_forcvar(5) = 1
call def_stream(nod2D, myDim_nod2D, 'prec', 'precipitation rain', 'm/s', prec_rain(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('snow ')
sel_forcvar(6) = 1
call def_stream(nod2D, myDim_nod2D, 'snow', 'precipitation snow', 'm/s', prec_snow(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('tair ')
sel_forcvar(3) = 1
call def_stream(nod2D, myDim_nod2D, 'tair', 'surface air temperature', '°C', Tair(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('shum ')
sel_forcvar(4) = 1
call def_stream(nod2D, myDim_nod2D, 'shum', 'specific humidity', '', shum(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('swr ')
sel_forcvar(8) = 1
call def_stream(nod2D, myDim_nod2D, 'swr', 'short wave radiation', 'W/m^2', shortwave(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('lwr ')
sel_forcvar(9) = 1
call def_stream(nod2D, myDim_nod2D, 'lwr', 'long wave radiation', 'W/m^2', longwave(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('uwind ')
sel_forcvar(1) = 1
call def_stream(nod2D, myDim_nod2D, 'uwind', '10m zonal surface wind velocity', 'm/s', u_wind(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('vwind ')
sel_forcvar(2) = 1
call def_stream(nod2D, myDim_nod2D, 'vwind', '10m merid. surface wind velocity','m/s', v_wind(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
!___________________________________________________________________________________________________________________________________
CASE ('virtsalt ')
sel_forcvar(13) = 1
call def_stream(nod2D , myDim_nod2D , 'virtsalt' , 'virtual salt flux' , 'm/s*psu', virtual_salt(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('relaxsalt ')
sel_forcvar(14) = 1
call def_stream(nod2D , myDim_nod2D , 'relaxsalt', 'relaxation salt flux' , 'm/s*psu', relax_salt(:) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('realsalt ')
sel_forcvar(15) = 1
call def_stream(nod2D , myDim_nod2D , 'realsalt' , 'real salt flux from sea ice', 'm/s*psu', real_salt_flux(:) , io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('ice_rejectsalt')
if (SPP) call def_stream(nod2D , myDim_nod2D , 'ice_rejectsalt' , 'salt flux from plum parameterisation ', 'm/s*psu', ice_rejected_salt(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
!___________________________________________________________________________________________________________________________________
! output KPP vertical mixing schemes
CASE ('kpp_obldepth ')
if (mix_scheme_nmb==1 .or. mix_scheme_nmb==17) then! fesom KPP
call def_stream(nod2D, myDim_nod2D, 'kpp_obldepth', 'KPP ocean boundary layer depth', 'm', hbl(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
#if defined (__cvmix)
elseif (mix_scheme_nmb==3 .or. mix_scheme_nmb==37) then ! cvmix KPP
call def_stream(nod2D, myDim_nod2D, 'kpp_obldepth', 'KPP ocean boundary layer depth', 'm', kpp_obldepth(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
#endif
end if
CASE ('kpp_sbuoyflx')
if (mix_scheme_nmb==1 .or. mix_scheme_nmb==17) then ! fesom KPP
call def_stream(nod2D, myDim_nod2D, 'kpp_sbuoyflx', 'surface buoyancy flux', 'm2/s3', Bo(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
#if defined (__cvmix)
elseif (mix_scheme_nmb==3 .or. mix_scheme_nmb==37) then ! cvmix KPP
call def_stream(nod2D, myDim_nod2D, 'kpp_sbuoyflx', 'surface buoyancy flux', 'm2/s3', kpp_sbuoyflx(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
#endif
end if
CASE ('tx_sur ')
sel_forcvar(11) = 1
call def_stream(elem2D, myDim_elem2D, 'tx_sur', 'zonal wind str. to ocean', 'N/m2', stress_surf(1, :), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('ty_sur ')
sel_forcvar(12) = 1
call def_stream(elem2D, myDim_elem2D, 'ty_sur', 'meridional wind str. to ocean', 'N/m2', stress_surf(2, :), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('curl_surf ')
if (lcurt_stress_surf) then
call def_stream(nod2D, myDim_nod2D, 'curl_surf', 'vorticity of the surface stress', 'none', curl_stress_surf(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
!___________________________________________________________________________________________________________________________________
! output RECOM 2D
#if defined(__recom)
CASE ('dpCO2s ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'dpCO2s', 'Difference of oceanic pCO2 minus atmospheric pCO2', 'uatm', GlodPCO2surf(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('pCO2s ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'pCO2s', 'Partial pressure of oceanic CO2', 'uatm', GloPCO2surf(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('CO2f ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'CO2f', 'CO2-flux into the surface water', 'mmolC/m2/d', GloCO2flux(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('O2f ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'O2f', 'O2-flux into the surface water', 'mmolO/m2/d', GloO2flux(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('Hp ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'Hp', 'Mean of H-plus ions in the surface water', 'mol/kg', GloHplus(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('aFe ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'aFe','Atmospheric iron input','umolFe/m2/s', AtmFeInput(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('aN ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'aN','Atmospheric DIN input','mmolN/m2/s', AtmNInput(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('benN ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'benN','Benthos Nitrogen','mmol', Benthos(:,1), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('benC ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'benC','Benthos Carbon','mmol', Benthos(:,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('benSi ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'benSi','Benthos silicon','mmol', Benthos(:,3), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('benCalc ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'benCalc','Benthos calcite','mmol', Benthos(:,4), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('NPPn ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'NPPn','Mean NPP nanophytoplankton','mmolC/m2/d', NPPn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('NPPd ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'NPPd','Mean NPP diatoms','mmolC/m2/d', NPPd, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('GPPn ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'GPPn','Mean GPP nanophytoplankton','mmolC/m2/d', GPPn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('GPPd ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'GPPd','Mean GPP diatoms','mmolC/m2/d', GPPd, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('NNAn ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'NNAn','Net N-assimilation nanophytoplankton','mmolN/m2/d', NNAn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('NNAd ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'NNAd','Net N-assimilation diatoms','mmolN/m2/d', NNAd, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('Chldegn ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'ChlDegn','Chlorophyll degradation nanophytoplankton','1/d', Chldegn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('Chldegd ')
if (use_REcoM) then
call def_stream(nod2D, myDim_nod2D, 'ChlDegd','Chlorophyll degradation diatoms','1/d', Chldegd, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('NPPc ')
if (use_REcoM) then
! call def_stream(nod2D, myDim_nod2D, 'NPPc','Mean NPP coccolithophores','mmolC/(m2*d)', diags2D(:,9), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW
call def_stream(nod2D, myDim_nod2D, 'NPPc','Mean NPP coccolithophores','mmolC/(m2*d)', NPPc, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW
end if
CASE ('GPPc ')
if (use_REcoM) then
! call def_stream(nod2D, myDim_nod2D, 'GPPc','Mean GPP coccolithophores','mmolC/(m2*d)', diags2D(:,10), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW
call def_stream(nod2D, myDim_nod2D, 'GPPc','Mean GPP coccolithophores','mmolC/(m2*d)', GPPc, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW
end if
CASE ('NNAc ')
if (use_REcoM) then
! call def_stream(nod2D, myDim_nod2D, 'NNAc','Net N-assimilation coccolithophores','mmolN/(m2*d)', diags2D(:,11), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW
call def_stream(nod2D, myDim_nod2D, 'NNAc','Net N-assimilation coccolithophores','mmolN/(m2*d)', NNAc, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) !NEW
endif
CASE ('Chldegc ')
if (use_REcoM) then
! call def_stream(nod2D, myDim_nod2D, 'GNAc','Gross N-assimilation coccolithophores','mmolN/(m2*d)', diags2D(:,12), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW
call def_stream(nod2D, myDim_nod2D, 'ChlDegc','Chlorophyll degradation coccolithophores','1/d', Chldegc, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW
endif
#endif
!___________________________________________________________________________________________________________________________________
!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 3D streams <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
!___________________________________________________________________________________________________________________________________
CASE ('temp ')
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'temp', 'temperature', 'C', tracers%data(1)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
CASE ('salt ')
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'salt', 'salinity', 'psu', tracers%data(2)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
#if defined(__recom)
CASE ('PAR ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PAR', 'PAR', 'W/m2', PAR3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
end if
CASE ('respmeso ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respmeso','Respiration rate of mesozooplankton', 'mmolC/m2/d', respmeso(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('respmacro ')
if (use_REcoM) then ! .and. three_zoo_two_det) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respmacro','Respiration rate of macrozooplankton', 'mmolC/m2/d', respmacro(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('respmicro ')
if (use_REcoM) then ! .and. three_zoo_two_det) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respmicro','Respiration rate of microzooplankton', 'mmolC/m2/d', respmicro(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('calcdiss ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'calcdiss','Calcite dissolution', 'mmolC/m2/d', calcdiss(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('calcif ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'calcif','Calcification', 'mmolC/m2/d', calcif(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('aggn ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'aggn','Aggregation of small phytoplankton', 'mmolC/m2/d', aggn(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('aggd ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'aggd','Aggregation of diatoms', 'mmolC/m2/d', aggd(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('aggc ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'aggc','Aggregation of coccolithophores', 'mmolC/m2/d', aggc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('docexn ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexn','DOC excretion by small phytoplankton', 'mmolC/m2/d', docexn(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('docexd ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexd','DOC excretion by diatoms', 'mmolC/m2/d', docexd(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('docexc ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexc','DOC excretion by coccolithophores', 'mmolC/m2/d', docexc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('respn ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respn','Respiration by small phytoplankton', 'mmolC/m2/d', respn(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('respd ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respd','Respiration by diatoms', 'mmolC/m2/d', respd(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('respc ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respc','Respiration by coccolithophores', 'mmolC/(m2*d)', respc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('NPPn3D ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPn3D','Net primary production of small phytoplankton', 'mmolC/m2/d', NPPn3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('NPPd3D ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPd3D','Net primary production of diatoms', 'mmolC/m2/d', NPPd3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
CASE ('NPPc3D ')
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPc3D','Net primary production of coccolithophores', 'mmolC/m2/d', NPPc3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
#endif
!CASE ('otracers ')
! do j=3, tracers%num_tracers
! write (id_string, "(I3.3)") tracers%data(j)%ID
! call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'tra_'//id_string, 'pasive tracer ID='//id_string, 'n/a', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
! end do
CASE ('otracers ')
do j=3, tracers%num_tracers
write (id_string, "(I4.4)") tracers%data(j)%ID
#if defined(__recom)
if (tracers%data(j)%ID==1001) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIN', 'Dissolved Inorganic Nitrogen', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1002) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC', 'Dissolved Inorganic C', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1003) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Alk', 'Total Alkalinity', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1004) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhyN', 'Intracellular conc of Nitrogen in small phytoplankton', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1005) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhyC', 'Intracellular conc of Carbon in small phytoplankton', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1006) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhyChl', 'Current intracellular ChlA conc.', '[mg/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1007) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DetN', 'Conc of N in Detritus', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1008) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DetC', 'Conc of C in Detritus', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1009) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'HetN', 'Conc of N in heterotrophs', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1010) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'HetC', 'Conc of C in heterotrophs', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1011) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DON', 'Dissolved organic N in the water', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1012) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DOC', 'Dissolved Organic C in the water', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1013) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DiaN', 'DiaN', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1014) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DiaC', 'DiaC', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1015) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DiaChl', 'DiaChl', '[mg/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1016) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DiaSi', 'DiaSi', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1017) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DetSi', 'DetSi', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1018) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DSi', 'DSi', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1019) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DFe', 'DFe', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1020) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhyCalc', 'PhyCalc', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1021) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DetCalc', 'DetCalc', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1022) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'O2', 'O2', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1023) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Zoo2N', 'Intracellular conc of Nitrogen in second zooplankton', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)
endif
else if (tracers%data(j)%ID==1024) then
if (use_REcoM) then
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Zoo2C', 'Intracellular conc of Carbon in second zooplankton', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh)