83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
104
105#if !defined PARALLEL_IO && defined DISTRIBUTE
107#endif
108
109
110
111 integer, intent(in) :: ng, model, ncid
112 integer, intent(in) :: DimIDs(nDimID)
113
114 character (*), intent(in) :: ncname
115
116
117
118 integer, parameter :: Natt = 25
119
120 integer :: brydim, i, ie, is, j, lstr, varid
121 integer :: srdim, stadim, status, swdim, trcdim, usrdim
122#ifdef SEDIMENT
123 integer :: seddim
124#endif
125#ifdef FOUR_DVAR
126 integer :: statedim
127#endif
128#if defined BIOLOGY && defined ECOSIM
129 integer :: bacdim, domdim, fecdim, lightdim, phydim
130
131 integer :: biodim(2)
132#endif
133#if !defined PARALLEL_IO && defined DISTRIBUTE
134 integer :: ibuffer(2)
135#endif
136 integer :: p2dgrd(2), tbrydim(2)
137 integer :: t2dgrd(3), u2dgrd(3), v2dgrd(3)
138
139 real(r8) :: Aval(6)
140
141 character (len=11 ) :: bryatt, clmatt, frcatt
142 character (len=50 ) :: tiling
143 character (len=80 ) :: type
144#ifdef FOUR_DVAR
145 character (len=512) :: state_vector
146#endif
147#ifdef BIOLOGY
148 character (len=512) :: bio_file
149#endif
150 character (len=4096) :: string
151 character (len=MaxLen) :: Vinfo(Natt)
152
153 character (len=*), parameter :: MyFile = &
154 & __FILE__//", def_info_nf90"
155
156 sourcefile=myfile
157
158
159
160
161
162 p2dgrd(1)=dimids(4)
163 p2dgrd(2)=dimids(8)
164 t2dgrd(1)=dimids(1)
165 t2dgrd(2)=dimids(5)
166 u2dgrd(1)=dimids(2)
167 u2dgrd(2)=dimids(6)
168 v2dgrd(1)=dimids(3)
169 v2dgrd(2)=dimids(7)
170 srdim=dimids(9)
171 swdim=dimids(10)
172 trcdim=dimids(11)
173#ifdef SEDIMENT
174 seddim=dimids(32)
175#endif
176 stadim=dimids(13)
177 brydim=dimids(14)
178#ifdef FOUR_DVAR
179 statedim=dimids(29)
180#endif
181 tbrydim(1)=dimids(11)
182 tbrydim(2)=dimids(14)
183#if defined ECOSIM && defined SOLVE3D
184 phydim=dimids(25)
185 bacdim=dimids(26)
186 domdim=dimids(27)
187 fecdim=dimids(28)
188 biodim(1)=phydim
189 biodim(2)=fecdim
190 lightdim=dimids(33)
191#endif
192
193
194
195 IF ((nuser.gt.0).and.(ncid.ne.gst(ng)%ncid)) THEN
196 status=def_dim(ng, model, ncid, ncname, 'Nuser', &
197 & nuser, usrdim)
198 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
199 END IF
200
201
202
203 DO i=1,natt
204 DO j=1,len(vinfo(1))
205 vinfo(i)(j:j)=' '
206 END DO
207 END DO
208 DO i=1,6
209 aval(i)=0.0_r8
210 END DO
211
212
213
214
215
216 IF (outthread) THEN
217
218
219
220 IF (len_trim(date_str).gt.0) THEN
221 WRITE (history,'(a,1x,a,", ",a)') 'ROMS, Version', &
222 & trim( version), &
223 & trim(date_str)
224 ELSE
225 WRITE (history,'(a,1x,a)') 'ROMS, Version', &
226 & trim(version)
227 END IF
228
229
230
231 WRITE (tiling,10) ntilei(ng), ntilej(ng)
232
233
234
235 IF (exit_flag.eq.noerror) THEN
236 status=nf90_put_att(ncid, nf90_global, 'file', &
237 & trim(ncname))
238 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
239 IF (master) WRITE (stdout,20) 'file', trim(ncname)
240 exit_flag=3
241 ioerror=status
242 END IF
243 END IF
244
245#ifndef DEBUGGING
246
247
248
249 IF (exit_flag.eq.noerror) THEN
250# ifdef HDF5
251 status=nf90_put_att(ncid, nf90_global, 'format', &
252 & 'netCDF-4/HDF5 file')
253# else
254 status=nf90_put_att(ncid, nf90_global, 'format', &
255 & 'netCDF-3 64bit offset file')
256# endif
257 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
258 IF (master) WRITE (stdout,20) 'format', trim(ncname)
259 exit_flag=3
260 ioerror=status
261 END IF
262 END IF
263
264#endif
265
266
267
268
269 type='CF-1.4, SGRID-0.3'
270 IF (exit_flag.eq.noerror) THEN
271 status=nf90_put_att(ncid, nf90_global, 'Conventions', &
272 & trim(type))
273 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
274 IF (master) WRITE (stdout,20) 'Conventions', trim(ncname)
275 exit_flag=3
276 ioerror=status
277 END IF
278 END IF
279
280
281
282 IF (ncid.eq.adm(ng)%ncid) THEN
283 type='ROMS adjoint history file'
284 ELSE IF (ncid.eq.avg(ng)%ncid) THEN
285#if defined AD_AVERAGES && defined ADJOINT
286 type='ROMS adjoint model averages file'
287#elif defined RP_AVERAGES && defined TL_IOMS
288 type='ROMS representer model averages file'
289#elif defined TL_AVERAGES && defined TANGENT
290 type='ROMS tangent linear model averages file'
291#else
292 type='ROMS nonlinear model averages file'
293#endif
294 ELSE IF (ncid.eq.dia(ng)%ncid) THEN
295 type='ROMS diagnostics file'
296 ELSE IF (ncid.eq.flt(ng)%ncid) THEN
297 type='ROMS floats file'
298 ELSE IF (ncid.eq.err(ng)%ncid) THEN
299 type='ROMS posterior analysis error covariance matrix'
300 ELSE IF (ncid.eq.gst(ng)%ncid) THEN
301 type='ROMS GST check pointing restart file'
302 ELSE IF (ncid.eq.har(ng)%ncid) THEN
303 type='ROMS Least-squared Detiding Harmonics file'
304 ELSE IF (ncid.eq.hss(ng)%ncid) THEN
305 type='ROMS 4D-Var Hessian eigenvectors file'
306 ELSE IF (ncid.eq.his(ng)%ncid) THEN
307 type='ROMS history file'
308 ELSE IF (ncid.eq.itl(ng)%ncid) THEN
309 type='ROMS tangent linear model initial file'
310 ELSE IF (ncid.eq.lcz(ng)%ncid) THEN
311 type='ROMS 4D-Var Lanczos vectors file'
312 ELSE IF (ncid.eq.lze(ng)%ncid) THEN
313 type='ROMS 4D-Var Evolved Lanczos vectors file'
314 ELSE IF (ncid.eq.nrm(1,ng)%ncid) THEN
315 type='ROMS initial conditions error covariance norm file'
316 ELSE IF (ncid.eq.nrm(2,ng)%ncid) THEN
317 type='ROMS model error covariance norm file'
318 ELSE IF (ncid.eq.nrm(3,ng)%ncid) THEN
319 type='ROMS boundary conditions error covariance norm file'
320 ELSE IF (ncid.eq.nrm(4,ng)%ncid) THEN
321 type='ROMS surface forcing error covariance norm file'
322 ELSE IF (ncid.eq.qck(ng)%ncid) THEN
323 type='ROMS quicksave file'
324 ELSE IF (ncid.eq.rst(ng)%ncid) THEN
325 type='ROMS restart file'
326# ifdef SP4DVAR
327 ELSE IF (ncid.eq.sca(ng)%ncid) THEN
328 type='ROMS AD scratch file'
329 ELSE IF (ncid.eq.sct(ng)%ncid) THEN
330 type='ROMS TL scratch file'
331 ELSE IF (ncid.eq.spa(ng)%ncid) THEN
332 type='ROMS AD Arnoldi file'
333 ELSE IF (ncid.eq.spt(ng)%ncid) THEN
334 type='ROMS TL Arnoldi file'
335# endif
336 ELSE IF (ncid.eq.sta(ng)%ncid) THEN
337 type='ROMS station file'
338 ELSE IF (ncid.eq.tlf(ng)%ncid) THEN
339 type='ROMS tangent linear impulse forcing file'
340 ELSE IF (ncid.eq.tlm(ng)%ncid) THEN
341 type='ROMS tangent linear history file'
342 END IF
343 IF (exit_flag.eq.noerror) THEN
344 status=nf90_put_att(ncid, nf90_global, 'type', &
345 & trim(type))
346 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
347 IF (master) WRITE (stdout,20) 'type', trim(ncname)
348 exit_flag=3
349 ioerror=status
350 END IF
351 END IF
352
353#ifdef FOUR_DVAR
354
355
356
357 is=1
358 state_vector=' '
359 DO i=1,nstatevar(ng)
360 lstr=len_trim(vname(1,idsvar(i)))
361 ie=is+lstr
362 state_vector(is:ie)=trim(vname(1,idsvar(i)))//', '
363 is=ie+2
364 END DO
365#endif
366
367
368
369 IF (exit_flag.eq.noerror) THEN
370 status=nf90_put_att(ncid, nf90_global, 'title', &
371 & trim(title))
372 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
373 IF (master) WRITE (stdout,20) 'title', trim(ncname)
374 exit_flag=3
375 ioerror=status
376 END IF
377 END IF
378
379 IF (exit_flag.eq.noerror) THEN
380 status=nf90_put_att(ncid, nf90_global, 'var_info', &
381 & trim(varname))
382 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
383 IF (master) WRITE (stdout,20) 'var_info', trim(ncname)
384 exit_flag=3
385 ioerror=status
386 END IF
387 END IF
388
389#ifdef FOUR_DVAR
390 IF (exit_flag.eq.noerror) THEN
391 lstr=len_trim(state_vector)-1
392 status=nf90_put_att(ncid, nf90_global, 'state_vector', &
393 & state_vector(1:lstr))
394 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
395 IF (master) WRITE (stdout,20) 'state_vector', trim(ncname)
396 exit_flag=3
397 ioerror=status
398 END IF
399 END IF
400#endif
401
402#ifdef PROPAGATOR
403 IF (exit_flag.eq.noerror) THEN
404 status=nf90_put_att(ncid, nf90_global, 'gst_file', &
405 & trim(gst(ng)%name))
406 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
407 IF (master) WRITE (stdout,20) 'gst_file', trim(ncname)
408 exit_flag=3
409 ioerror=status
410 END IF
411 END IF
412#endif
413
414 IF (exit_flag.eq.noerror) THEN
415 status=nf90_put_att(ncid, nf90_global, 'rst_file', &
416 & trim(rst(ng)%name))
417 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
418 IF (master) WRITE (stdout,20) 'rst_file', trim(ncname)
419 exit_flag=3
420 ioerror=status
421 END IF
422 END IF
423
424 IF (exit_flag.eq.noerror) THEN
425 IF (ldefhis(ng)) THEN
426 IF (ndefhis(ng).gt.0) THEN
427 status=nf90_put_att(ncid, nf90_global, 'his_base', &
428 & trim(his(ng)%base))
429 ELSE
430 status=nf90_put_att(ncid, nf90_global, 'his_file', &
431 & trim(his(ng)%name))
432 END IF
433 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
434 IF (master) WRITE (stdout,20) 'his_file', trim(ncname)
435 exit_flag=3
436 ioerror=status
437 END IF
438 END IF
439 END IF
440
441#ifdef GRID_EXTRACT
442 IF (exit_flag.eq.noerror) THEN
443 status=nf90_put_att(ncid, nf90_global, 'extract_grid', &
444 & trim(grx(ng)%name))
445 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
446 IF (master) WRITE (stdout,20) 'extract_grid', trim(ncname)
447 exit_flag=3
448 ioerror=status
449 END IF
450 END IF
451
452 IF (exit_flag.eq.noerror) THEN
453 IF (ldefxtr(ng)) THEN
454 IF (ndefxtr(ng).gt.0) THEN
455 status=nf90_put_att(ncid, nf90_global, 'extract_base', &
456 & trim(xtr(ng)%base))
457 ELSE
458 status=nf90_put_att(ncid, nf90_global, 'extract_file', &
459 & trim(xtr(ng)%name))
460 END IF
461 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
462 IF (master) WRITE (stdout,20) 'extract_file', trim(ncname)
463 exit_flag=3
464 ioerror=status
465 END IF
466 END IF
467 END IF
468#endif
469
470#if defined AVERAGES || \
471 (defined ad_averages && defined adjoint) || \
472 (defined rp_averages && defined tl_ioms) || \
473 (defined tl_averages && defined tangent)
474 IF (exit_flag.eq.noerror) THEN
475 IF (ndefavg(ng).gt.0) THEN
476 status=nf90_put_att(ncid, nf90_global, 'avg_base', &
477 & trim(avg(ng)%base))
478 ELSE
479 status=nf90_put_att(ncid, nf90_global, 'avg_file', &
480 & trim(avg(ng)%name))
481 END IF
482 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
483 IF (master) WRITE (stdout,20) 'avg_file', trim(ncname)
484 exit_flag=3
485 ioerror=status
486 END IF
487 END IF
488#endif
489
490#if defined AVERAGES && defined AVERAGES_DETIDE && \
491 (defined ssh_tides || defined uv_tides)
492 IF (exit_flag.eq.noerror) THEN
493 status=nf90_put_att(ncid, nf90_global, 'har_file', &
494 & trim(har(ng)%name))
495 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
496 IF (master) WRITE (stdout,20) 'har_file', trim(ncname)
497 exit_flag=3
498 ioerror=status
499 END IF
500 END IF
501#endif
502
503#ifdef DIAGNOSTICS
504 IF (exit_flag.eq.noerror) THEN
505 IF (ndefdia(ng).gt.0) THEN
506 status=nf90_put_att(ncid,nf90_global, 'dia_base', &
507 & trim(dia(ng)%base))
508 ELSE
509 status=nf90_put_att(ncid, nf90_global, 'dia_file', &
510 & trim(dia(ng)%name))
511 END IF
512 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
513 IF (master) WRITE (stdout,20) 'dia_file', trim(ncname)
514 exit_flag=3
515 ioerror=status
516 END IF
517 END IF
518#endif
519
520#if defined WEAK_CONSTRAINT && \
521 (defined posterior_error_f || defined posterior_error_i)
522 IF (exit_flag.eq.noerror) THEN
523 status=nf90_put_att(ncid, nf90_global, 'err_file', &
524 & trim(err(ng)%name))
525 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
526 IF (master) WRITE (stdout,20) 'err_file', trim(ncname)
527 exit_flag=3
528 ioerror=status
529 END IF
530 END IF
531#endif
532
533#ifdef STATIONS
534 IF (exit_flag.eq.noerror) THEN
535 status=nf90_put_att(ncid, nf90_global, 'sta_file', &
536 & trim(sta(ng)%name))
537 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
538 IF (master) WRITE (stdout,20) 'sta_file', trim(ncname)
539 exit_flag=3
540 ioerror=status
541 END IF
542 END IF
543#endif
544
545#ifdef FLOATS
546 IF (exit_flag.eq.noerror) THEN
547 status=nf90_put_att(ncid, nf90_global, 'flt_file', &
548 & trim(flt(ng)%name))
549 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
550 IF (master) WRITE (stdout,20) 'flt_file', trim(ncname)
551 exit_flag=3
552 ioerror=status
553 END IF
554 END IF
555#endif
556
557#ifndef ANA_GRID
558 IF (exit_flag.eq.noerror) THEN
559 status=nf90_put_att(ncid, nf90_global, 'grd_file', &
560 & trim(grd(ng)%name))
561 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
562 IF (master) WRITE (stdout,20) 'grd_file', trim(ncname)
563 exit_flag=3
564 ioerror=status
565 END IF
566 END IF
567#endif
568
569#ifdef INI_FILE
570# ifdef NONLINEAR
571 IF (exit_flag.eq.noerror) THEN
572 status=nf90_put_att(ncid, nf90_global, 'ini_file', &
573 & trim(ini(ng)%name))
574 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
575 IF (master) WRITE (stdout,20) 'ini_file', trim(ncname)
576 exit_flag=3
577 ioerror=status
578 END IF
579 END IF
580# endif
581
582# ifdef TANGENT
583 IF (exit_flag.eq.noerror) THEN
584 status=nf90_put_att(ncid,nf90_global, 'itl_file', &
585 & trim(itl(ng)%name))
586 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
587 IF (master) WRITE (stdout,20) 'itl_file', trim(ncname)
588 exit_flag=3
589 ioerror=status
590 END IF
591 END IF
592# endif
593
594# if defined ADJOINT && \
595
596 defined i4dvar_ana_sensitivity || defined opt_observations || \
597 defined sensitivity_4dvar || defined so_semi || \
598 defined stochastic_opt )
599 IF (exit_flag.eq.noerror) THEN
600 status=nf90_put_att(ncid, nf90_global, 'iad_file', &
601 & trim(iad(ng)%name))
602 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
603 IF (master) WRITE (stdout,20) 'iad_file', trim(ncname)
604 exit_flag=3
605 ioerror=status
606 END IF
607 END IF
608# endif
609#endif
610
611#if defined I4DVAR || defined OPT_OBSERVATIONS || \
612 defined weak_constraint
613 IF (exit_flag.eq.noerror) THEN
614 status=nf90_put_att(ncid, nf90_global, 'nrm_file', &
615 & trim(nrm(1,ng)%name))
616 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
617 IF (master) WRITE (stdout,20) 'nrm_file', trim(ncname)
618 exit_flag=3
619 ioerror=status
620 END IF
621 END IF
622#endif
623
624#ifdef WEAK_CONSTRAINT
625 IF (exit_flag.eq.noerror) THEN
626 status=nf90_put_att(ncid, nf90_global, 'tlf_file', &
627 & trim(tlf(ng)%name))
628 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
629 IF (master) WRITE (stdout,20) 'tlf_file', trim(ncname)
630 exit_flag=3
631 ioerror=status
632 END IF
633 END IF
634#endif
635
636#ifdef FOUR_DVAR
637 IF (exit_flag.eq.noerror) THEN
638 status=nf90_put_att(ncid, nf90_global, 'obs_file', &
639 & trim(obs(ng)%name))
640 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
641 IF (master) WRITE (stdout,20) 'obs_file', trim(ncname)
642 exit_flag=3
643 ioerror=status
644 END IF
645 END IF
646#endif
647
648#ifdef RBL4DVAR_FCT_SENSITIVITY
649 IF (exit_flag.eq.noerror) THEN
650 status=nf90_put_att(ncid, nf90_global, 'fcta_file', &
651 & trim(fcta(ng)%name))
652 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
653 IF (master) WRITE (stdout,20) 'fcta_file', trim(ncname)
654 exit_flag=3
655 ioerror=status
656 END IF
657 END IF
658
659 IF (exit_flag.eq.noerror) THEN
660 status=nf90_put_att(ncid, nf90_global, 'fctb_file', &
661 & trim(fctb(ng)%name))
662 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
663 IF (master) WRITE (stdout,20) 'fctb_file', trim(ncname)
664 exit_flag=3
665 ioerror=status
666 END IF
667 END IF
668
669# ifdef OBS_SPACE
670 IF (exit_flag.eq.noerror) THEN
671 status=nf90_put_att(ncid, nf90_global, 'oifa_file', &
672 & trim(oifa(ng)%name))
673 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
674 IF (master) WRITE (stdout,20) 'oifa_file', trim(ncname)
675 exit_flag=3
676 ioerror=status
677 END IF
678 END IF
679
680 IF (exit_flag.eq.noerror) THEN
681 status=nf90_put_att(ncid, nf90_global, 'oifb_file', &
682 & trim(oifb(ng)%name))
683 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
684 IF (master) WRITE (stdout,20) 'oifb_file', trim(ncname)
685 exit_flag=3
686 ioerror=status
687 END IF
688 END IF
689# else
690 IF (exit_flag.eq.noerror) THEN
691 status=nf90_put_att(ncid, nf90_global, 'foia_file', &
692 & trim(foia(ng)%name))
693 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
694 IF (master) WRITE (stdout,20) 'foia_file', trim(ncname)
695 exit_flag=3
696 ioerror=status
697 END IF
698 END IF
699
700 IF (exit_flag.eq.noerror) THEN
701 status=nf90_put_att(ncid, nf90_global, 'foib_file', &
702 & trim(foib(ng)%name))
703 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
704 IF (master) WRITE (stdout,20) 'foib_file', trim(ncname)
705 exit_flag=3
706 ioerror=status
707 END IF
708 END IF
709# endif
710#endif
711
712#ifndef ANA_PSOURCE
713 IF (exit_flag.eq.noerror) THEN
714 IF (luvsrc(ng).or.lwsrc(ng).or.(any(ltracersrc(:,ng)))) THEN
715 status=nf90_put_att(ncid, nf90_global, 'river_file', &
716 & trim(ssf(ng)%name))
717 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
718 IF (master) WRITE (stdout,20) 'river_file', trim(ncname)
719 exit_flag=3
720 ioerror=status
721 END IF
722 END IF
723 END IF
724#endif
725
726#if defined SSH_TIDES || defined UV_TIDES
727 IF (exit_flag.eq.noerror) THEN
728 IF (lprocesstides(ng)) THEN
729 status=nf90_put_att(ncid, nf90_global, 'tide_file', &
730 & trim(tide(ng)%name))
731 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
732 IF (master) WRITE (stdout,20) 'tide_file', trim(ncname)
733 exit_flag=3
734 ioerror=status
735 END IF
736 END IF
737 END IF
738#endif
739
740#ifdef FRC_FILE
741 IF (exit_flag.eq.noerror) THEN
742 DO i=1,nffiles(ng)
743 CALL join_string (frc(i,ng)%files, frc(i,ng)%Nfiles, &
744 & string, lstr)
745 WRITE (frcatt,30) 'frc_file_', i
746 status=nf90_put_att(ncid, nf90_global, frcatt, &
747 & string(1:lstr))
748 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
749 IF (master) WRITE (stdout,20) trim(frcatt), trim(ncname)
750 exit_flag=3
751 ioerror=status
752 EXIT
753 END IF
754 END DO
755 END IF
756#endif
757
758 IF (obcdata(ng)) THEN
759 DO i=1,nbcfiles(ng)
760 IF (exit_flag.eq.noerror) THEN
761 CALL join_string (bry(i,ng)%files, bry(i,ng)%Nfiles, &
762 & string, lstr)
763 WRITE (bryatt,30) 'bry_file_', i
764 status=nf90_put_att(ncid, nf90_global, bryatt, &
765 & string(1:lstr))
766 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
767 IF (master) WRITE (stdout,20) trim(bryatt), trim(ncname)
768 exit_flag=3
769 ioerror=status
770 END IF
771 END IF
772 END DO
773 END IF
774
775#if !(defined ANA_SSH || defined ANA_M2CLIMA || \
776 defined ana_m3clima || defined ana_tclima)
777 IF (lclimatology(ng)) THEN
778 DO i=1,nclmfiles(ng)
779 IF (exit_flag.eq.noerror) THEN
780 CALL join_string (clm(i,ng)%files, clm(i,ng)%Nfiles, &
781 & string, lstr)
782 WRITE (clmatt,30) 'clm_file_', i
783 status=nf90_put_att(ncid, nf90_global, clmatt, &
784 & string(1:lstr))
785 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
786 IF (master) WRITE (stdout,20) trim(clmatt), trim(ncname)
787 exit_flag=3
788 ioerror=status
789 END IF
790 END IF
791 END DO
792 END IF
793#endif
794
795#ifndef ANA_NUDGCOEF
796 IF (lnudging(ng)) THEN
797 IF (exit_flag.eq.noerror) THEN
798 status=nf90_put_att(ncid, nf90_global, 'nud_file', &
799 & trim(nud(ng)%name))
800 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
801 IF (master) WRITE (stdout,20) 'nud_file', trim(ncname)
802 exit_flag=3
803 ioerror=status
804 END IF
805 END IF
806 END IF
807#endif
808
809#ifdef FORWARD_READ
810 IF (exit_flag.eq.noerror) THEN
811 status=nf90_put_att(ncid, nf90_global, 'fwd_file', &
812 & trim(fwd(ng)%name))
813 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
814 IF (master) WRITE (stdout,20) 'fwd_file', trim(ncname)
815 exit_flag=3
816 ioerror=status
817 END IF
818 END IF
819#endif
820
821#if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
822 defined opt_observations || defined sensitivity_4dvar || \
823 defined so_semi
824 IF (exit_flag.eq.noerror) THEN
825 status=nf90_put_att(ncid, nf90_global, 'ads_file', &
826 & trim(ads(ng)%name))
827 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
828 IF (master) WRITE (stdout,20) 'ads_file', trim(ncname)
829 exit_flag=3
830 ioerror=status
831 END IF
832 END IF
833#endif
834
835#if !defined DEBUGGING && defined DISTRIBUTE
836 IF (exit_flag.eq.noerror) THEN
837 status=nf90_put_att(ncid, nf90_global, 'script_file', &
838 & trim(iname))
839 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
840 IF (master) WRITE (stdout,20) 'script_file', trim(ncname)
841 exit_flag=3
842 ioerror=status
843 END IF
844 END IF
845#endif
846
847#ifdef FOUR_DVAR
848 IF (exit_flag.eq.noerror) THEN
849 status=nf90_put_att(ncid, nf90_global, 'apar_file', &
850 & trim(aparnam))
851 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
852 IF (master) WRITE (stdout,20) 'apar_file', trim(ncname)
853 exit_flag=3
854 ioerror=status
855 END IF
856 END IF
857#endif
858
859#ifdef BIOLOGY
860 IF (exit_flag.eq.noerror) THEN
861 status=nf90_put_att(ncid, nf90_global, 'bpar_file', &
862 & trim(bparnam))
863 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
864 IF (master) WRITE (stdout,20) 'bpar_file', trim(ncname)
865 exit_flag=3
866 ioerror=status
867 END IF
868 END IF
869#endif
870
871#ifdef FLOATS
872 IF (exit_flag.eq.noerror) THEN
873 status=nf90_put_att(ncid, nf90_global, 'fpos_file', &
874 & trim(fposnam))
875 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
876 IF (master) WRITE (stdout,20) 'fpos_file', trim(ncname)
877 exit_flag=3
878 ioerror=status
879 END IF
880 END IF
881#endif
882
883#ifdef STATIONS
884 IF (exit_flag.eq.noerror) THEN
885 status=nf90_put_att(ncid, nf90_global, 'spos_file', &
886 & trim(sposnam))
887 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
888 IF (master) WRITE (stdout,20) 'spos_file', trim(ncname)
889 exit_flag=3
890 ioerror=status
891 END IF
892 END IF
893#endif
894
895#ifndef DEBUGGING
896# ifdef SOLVE3D
897
898
899
900 IF (exit_flag.eq.noerror) THEN
901 CALL tadv_putatt (ng, ncid, ncname, 'NLM_TADV', &
902 & hadvection, vadvection, status)
903 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
904 IF (master) WRITE (stdout,20) 'NLM_TADV', trim(ncname)
905 exit_flag=3
906 ioerror=status
907 END IF
908 END IF
909
910# if defined ADJOINT || defined TANGENT || defined TL_IOMS
911 IF (exit_flag.eq.noerror) THEN
912 CALL tadv_putatt (ng, ncid, ncname, 'ADM_TADV', &
913 & ad_hadvection, ad_vadvection, status)
914 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
915 IF (master) WRITE (stdout,20) 'NLM_TADV', trim(ncname)
916 exit_flag=3
917 ioerror=status
918 END IF
919 END IF
920# endif
921# endif
922
923
924
925 IF (exit_flag.eq.noerror) THEN
926 CALL lbc_putatt (ng, ncid, ncname, 'NLM_LBC', lbc, status)
927 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
928 IF (master) WRITE (stdout,20) 'NLM_LBC', trim(ncname)
929 exit_flag=3
930 ioerror=status
931 END IF
932 END IF
933
934# if defined ADJOINT || defined TANGENT || defined TL_IOMS
935
936
937
938 IF (exit_flag.eq.noerror) THEN
939 CALL lbc_putatt (ng, ncid, ncname, 'ADM_LBC', ad_lbc, status)
940 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
941 IF (master) WRITE (stdout,20) 'ADM_LBC', trim(ncname)
942 exit_flag=3
943 ioerror=status
944 END IF
945 END IF
946# endif
947#endif
948#ifdef GIT_URL
949
950
951
952 IF (exit_flag.eq.noerror) THEN
953 status=nf90_put_att(ncid, nf90_global, 'git_url', &
954 & trim(git_url))
955 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
956 IF (master) WRITE (stdout,20) 'git_url', trim(ncname)
957 exit_flag=3
958 ioerror=status
959 END IF
960 END IF
961#endif
962#if !defined DEBUGGING && defined GIT_REV
963 IF (exit_flag.eq.noerror) THEN
964 status=nf90_put_att(ncid, nf90_global, 'git_rev', &
965 & trim(git_rev))
966 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
967 IF (master) WRITE (stdout,20) 'git_rev', trim(ncname)
968 exit_flag=3
969 ioerror=status
970 END IF
971 END IF
972#endif
973
974
975
976 IF (exit_flag.eq.noerror) THEN
977 status=nf90_put_att(ncid, nf90_global, 'svn_url', &
978 & trim(svn_url))
979 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
980 IF (master) WRITE (stdout,20) 'svn_url', trim(ncname)
981 exit_flag=3
982 ioerror=status
983 END IF
984 END IF
985
986#if !defined DEBUGGING && defined SVN_REV
987 IF (exit_flag.eq.noerror) THEN
988 status=nf90_put_att(ncid, nf90_global, 'svn_rev', &
989 & trim(svn_rev))
990 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
991 IF (master) WRITE (stdout,20) 'svn_rev', trim(ncname)
992 exit_flag=3
993 ioerror=status
994 END IF
995 END IF
996#endif
997#ifndef DEBUGGING
998
999
1000
1001
1002# ifdef ROOT_DIR
1003 IF (exit_flag.eq.noerror) THEN
1004 status=nf90_put_att(ncid, nf90_global, 'code_dir', &
1005 & trim(rdir))
1006 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1007 IF (master) WRITE (stdout,20) 'code_dir', trim(ncname)
1008 exit_flag=3
1009 ioerror=status
1010 END IF
1011 END IF
1012# endif
1013
1014# ifdef HEADER_DIR
1015 IF (exit_flag.eq.noerror) THEN
1016 status=nf90_put_att(ncid, nf90_global, 'header_dir', &
1017 & trim(hdir))
1018 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1019 IF (master) WRITE (stdout,20) 'header_dir', trim(ncname)
1020 exit_flag=3
1021 ioerror=status
1022 END IF
1023 END IF
1024# endif
1025
1026# ifdef ROMS_HEADER
1027 IF (exit_flag.eq.noerror) THEN
1028 status=nf90_put_att(ncid, nf90_global, 'header_file', &
1029 & trim(hfile))
1030 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1031 IF (master) WRITE (stdout,20) 'header_file', trim(ncname)
1032 exit_flag=3
1033 ioerror=status
1034 END IF
1035 END IF
1036# endif
1037#endif
1038#ifndef DEBUGGING
1039
1040
1041
1042 IF (exit_flag.eq.noerror) THEN
1043 status=nf90_put_att(ncid, nf90_global, 'os', &
1044 & trim(my_os))
1045 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1046 IF (master) WRITE (stdout,20) 'os', trim(ncname)
1047 exit_flag=3
1048 ioerror=status
1049 END IF
1050 END IF
1051
1052 IF (exit_flag.eq.noerror) THEN
1053 status=nf90_put_att(ncid, nf90_global, 'cpu', &
1054 & trim(my_cpu))
1055 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1056 IF (master) WRITE (stdout,20) 'cpu', trim(ncname)
1057 exit_flag=3
1058 ioerror=status
1059 END IF
1060 END IF
1061
1062 IF (exit_flag.eq.noerror) THEN
1063 status=nf90_put_att(ncid, nf90_global, 'compiler_system', &
1064 & trim(my_fort))
1065 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1066 IF (master) WRITE (stdout,20) 'compiler_system', &
1067 & trim(ncname)
1068 exit_flag=3
1069 ioerror=status
1070 END IF
1071 END IF
1072
1073 IF (exit_flag.eq.noerror) THEN
1074 status=nf90_put_att(ncid, nf90_global, 'compiler_command', &
1075 & trim(my_fc))
1076 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1077 IF (master) WRITE (stdout,20) 'compiler_command', &
1078 & trim(ncname)
1079 exit_flag=3
1080 ioerror=status
1081 END IF
1082 END IF
1083
1084 IF (exit_flag.eq.noerror) THEN
1085 lstr=index(my_fflags, 'free')-2
1086 IF (lstr.le.0) lstr=len_trim(my_fflags)
1087 status=nf90_put_att(ncid, nf90_global, 'compiler_flags', &
1088 & my_fflags(1:lstr))
1089 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1090 IF (master) WRITE (stdout,20) 'compiler_flags', trim(ncname)
1091 exit_flag=3
1092 ioerror=status
1093 END IF
1094 END IF
1095
1096
1097
1098 IF (exit_flag.eq.noerror) THEN
1099 status=nf90_put_att(ncid, nf90_global, 'tiling', &
1100 & trim(tiling))
1101 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1102 IF (master) WRITE (stdout,20) 'tiling', trim(ncname)
1103 exit_flag=3
1104 ioerror=status
1105 END IF
1106 END IF
1107
1108 IF (exit_flag.eq.noerror) THEN
1109 status=nf90_put_att(ncid, nf90_global, 'history', &
1110 & trim(history))
1111 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1112 IF (master) WRITE (stdout,20) 'history', trim(ncname)
1113 exit_flag=3
1114 ioerror=status
1115 END IF
1116 END IF
1117
1118
1119
1120 IF (exit_flag.eq.noerror) THEN
1121 CALL join_string (ananame, SIZE(ananame), string, lstr)
1122 IF (lstr.gt.0) THEN
1123 status=nf90_put_att(ncid, nf90_global, 'ana_file', &
1124 & string(1:lstr))
1125 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1126 IF (master) WRITE (stdout,20) 'ana_file', trim(ncname)
1127 exit_flag=3
1128 ioerror=status
1129 END IF
1130 END IF
1131 END IF
1132#endif
1133
1134#ifdef BIOLOGY
1135
1136
1137
1138 IF (exit_flag.eq.noerror) THEN
1139 DO i=1,512
1140 bio_file(i:i)='-'
1141 END DO
1142 status=nf90_put_att(ncid, nf90_global, 'bio_file', &
1143 & bio_file)
1144 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1145 IF (master) WRITE (stdout,20) 'bio_file', trim(ncname)
1146 exit_flag=3
1147 ioerror=status
1148 END IF
1149 END IF
1150#endif
1151
1152#ifndef DEBUGGING
1153
1154
1155
1156 IF (exit_flag.eq.noerror) THEN
1157 lstr=len_trim(coptions)-1
1158 status=nf90_put_att(ncid, nf90_global, 'CPP_options', &
1159 & trim(coptions(1:lstr)))
1160 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
1161 IF (master) WRITE (stdout,20) 'CPP_options', trim(ncname)
1162 exit_flag=3
1163 ioerror=status
1164 END IF
1165 END IF
1166#endif
1167 END IF
1168
1169#if !defined PARALLEL_IO && defined DISTRIBUTE
1170 ibuffer(1)=exit_flag
1171 ibuffer(2)=ioerror
1173 exit_flag=ibuffer(1)
1174 ioerror=ibuffer(2)
1175#endif
1176 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1177
1178#ifdef PROPAGATOR
1179
1180
1181
1182
1183 IF (ncid.eq.gst(ng)%ncid) RETURN
1184#endif
1185
1186
1187
1188
1189
1190
1191
1192 vinfo( 1)='ntimes'
1193 vinfo( 2)='number of long time-steps'
1194 status=def_var(ng, model, ncid, varid, nf90_int, &
1195 & 1, (/0/), aval, vinfo, ncname, &
1196 & setparaccess = .false.)
1197 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1198
1199 vinfo( 1)='ndtfast'
1200 vinfo( 2)='number of short time-steps'
1201 status=def_var(ng, model, ncid, varid, nf90_int, &
1202 & 1, (/0/), aval, vinfo, ncname, &
1203 & setparaccess = .false.)
1204 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1205
1206 vinfo( 1)='dt'
1207 vinfo( 2)='size of long time-steps'
1208 vinfo( 3)='second'
1209 status=def_var(ng, model, ncid, varid,
nf_tout, &
1210 & 1, (/0/), aval, vinfo, ncname, &
1211 & setparaccess = .false.)
1212 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1213
1214 vinfo( 1)='dtfast'
1215 vinfo( 2)='size of short time-steps'
1216 vinfo( 3)='second'
1217 status=def_var(ng, model, ncid, varid,
nf_tout, &
1218 & 1, (/0/), aval, vinfo, ncname, &
1219 & setparaccess = .false.)
1220 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1221
1222 vinfo( 1)='dstart'
1223 vinfo( 2)='time stamp assigned to model initilization'
1224 WRITE (vinfo( 3),'(a,a)') 'days since ', trim(rclock%string)
1225 vinfo( 4)=trim(rclock%calendar)
1226 status=def_var(ng, model, ncid, varid,
nf_tout, &
1227 & 1, (/0/), aval, vinfo, ncname, &
1228 & setparaccess = .false.)
1229 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1230
1231#ifdef RBL4DVAR_FCT_SENSITIVITY
1232 vinfo( 1)='ntimes_ana'
1233 vinfo( 2)='number of time-steps for observation impacts, '// &
1234 & 'analysis interval'
1235 status=def_var(ng, model, ncid, varid, nf90_int, &
1236 & 1, (/0/), aval, vinfo, ncname, &
1237 & setparaccess = .false.)
1238 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1239
1240 vinfo( 1)='ntimes_fct'
1241 vinfo( 2)='number of time-steps for observation impacts, '// &
1242 & 'forecast interval'
1243 status=def_var(ng, model, ncid, varid, nf90_int, &
1244 & 1, (/0/), aval, vinfo, ncname, &
1245 & setparaccess = .false.)
1246 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1247#endif
1248
1249#if defined HDF5 && defined DEFLATE
1250 vinfo( 1)='shuffle'
1251 vinfo( 2)='NetCDF-4/HDF5 file format shuffle filer flag'
1252 status=def_var(ng, model, ncid, varid, nf90_int, &
1253 & 1, (/0/), aval, vinfo, ncname, &
1254 & setparaccess = .false.)
1255 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1256
1257 vinfo( 1)='deflate'
1258 vinfo( 2)='NetCDF-4/HDF5 file format deflate filer flag'
1259 status=def_var(ng, model, ncid, varid, nf90_int, &
1260 & 1, (/0/), aval, vinfo, ncname, &
1261 & setparaccess = .false.)
1262 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1263
1264 vinfo( 1)='deflate_level'
1265 vinfo( 2)='NetCDF-4/HDF5 file format deflate level parameter'
1266 status=def_var(ng, model, ncid, varid, nf90_int, &
1267 & 1, (/0/), aval, vinfo, ncname, &
1268 & setparaccess = .false.)
1269 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1270#endif
1271
1272 vinfo( 1)='nHIS'
1273 vinfo( 2)='number of time-steps between history records'
1274 status=def_var(ng, model, ncid, varid, nf90_int, &
1275 & 1, (/0/), aval, vinfo, ncname, &
1276 & setparaccess = .false.)
1277 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1278
1279 vinfo( 1)='ndefHIS'
1280 vinfo( 2)= &
1281 & 'number of time-steps between the creation of history files'
1282 status=def_var(ng, model, ncid, varid, nf90_int, &
1283 & 1, (/0/), aval, vinfo, ncname, &
1284 & setparaccess = .false.)
1285 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1286
1287#ifdef GRID_EXTRACT
1288 vinfo( 1)='nXTR'
1289 vinfo( 2)='number of time-steps between extract history records'
1290 status=def_var(ng, model, ncid, varid, nf90_int, &
1291 & 1, (/0/), aval, vinfo, ncname, &
1292 & setparaccess = .false.)
1293 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1294
1295 vinfo( 1)='ndefXTR'
1296 vinfo( 2)='number of time-steps between the creation of '// &
1297 & 'extract history files'
1298 status=def_var(ng, model, ncid, varid, nf90_int, &
1299 & 1, (/0/), aval, vinfo, ncname, &
1300 & setparaccess = .false.)
1301 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1302
1303 vinfo( 1)='ExtractFlag'
1304 vinfo( 2)='field extraction flag to interpolate or decimate'
1305 status=def_var(ng, model, ncid, varid, nf90_int, &
1306 & 1, (/0/), aval, vinfo, ncname, &
1307 & setparaccess = .false.)
1308 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1309#endif
1310
1311 vinfo( 1)='nRST'
1312 vinfo( 2)='number of time-steps between restart records'
1313 IF (lcyclerst(ng)) THEN
1314 vinfo(13)='only latest two records are maintained'
1315 END IF
1316 status=def_var(ng, model, ncid, varid, nf90_int, &
1317 & 1, (/0/), aval, vinfo, ncname, &
1318 & setparaccess = .false.)
1319 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1320
1321#if defined AVERAGES || \
1322 (defined ad_averages && defined adjoint) || \
1323 (defined rp_averages && defined tl_ioms) || \
1324 (defined tl_averages && defined tangent)
1325 vinfo( 1)='ntsAVG'
1326 vinfo( 2)= &
1327 & 'starting time-step for accumulation of time-averaged fields'
1328 status=def_var(ng, model, ncid, varid, nf90_int, &
1329 & 1, (/0/), aval, vinfo, ncname, &
1330 & setparaccess = .false.)
1331 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1332
1333 vinfo( 1)='nAVG'
1334 vinfo( 2)='number of time-steps between time-averaged records'
1335 status=def_var(ng, model, ncid, varid, nf90_int, &
1336 & 1, (/0/), aval, vinfo, ncname, &
1337 & setparaccess = .false.)
1338 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1339
1340 vinfo( 1)='ndefAVG'
1341 vinfo( 2)= &
1342 & 'number of time-steps between the creation of average files'
1343 status=def_var(ng, model, ncid, varid, nf90_int, &
1344 & 1, (/0/), aval, vinfo, ncname, &
1345 & setparaccess = .false.)
1346 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1347#endif
1348
1349#ifdef ADJOINT
1350 vinfo( 1)='nADJ'
1351 vinfo( 2)='number of time-steps between adjoint history records'
1352 status=def_var(ng, model, ncid, varid, nf90_int, &
1353 & 1, (/0/), aval, vinfo, ncname, &
1354 & setparaccess = .false.)
1355 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1356
1357 vinfo( 1)='ndefADJ'
1358 vinfo( 2)= &
1359 & 'number of time-steps between the creation of adjoint files'
1360 status=def_var(ng, model, ncid, varid, nf90_int, &
1361 & 1, (/0/), aval, vinfo, ncname, &
1362 & setparaccess = .false.)
1363 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1364#endif
1365
1366#ifdef TANGENT
1367 vinfo( 1)='nTLM'
1368 vinfo( 2)='number of time-steps between tangent history records'
1369 status=def_var(ng, model, ncid, varid, nf90_int, &
1370 & 1, (/0/), aval, vinfo, ncname, &
1371 & setparaccess = .false.)
1372 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1373
1374 vinfo( 1)='ndefTLM'
1375 vinfo( 2)= &
1376 & 'number of time-steps between the creation of tanget files'
1377 status=def_var(ng, model, ncid, varid, nf90_int, &
1378 & 1, (/0/), aval, vinfo, ncname, &
1379 & setparaccess = .false.)
1380 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1381#endif
1382
1383#ifdef ADJUST_BOUNDARY
1384 vinfo( 1)='nOBC'
1385 vinfo( 2)= &
1386 & 'number of time-steps between 4D-Var open boundary adjustment'
1387 status=def_var(ng, model, ncid, varid, nf90_int, &
1388 & 1, (/0/), aval, vinfo, ncname, &
1389 & setparaccess = .false.)
1390 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1391#endif
1392
1393#if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
1394 vinfo( 1)='nSFF'
1395 vinfo( 2)= &
1396 & 'number of time-steps between 4D-Var surface forcing adjustment'
1397 status=def_var(ng, model, ncid, varid, nf90_int, &
1398 & 1, (/0/), aval, vinfo, ncname, &
1399 & setparaccess = .false.)
1400 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1401#endif
1402
1403#ifdef PROPAGATOR
1404 vinfo( 1)='LmultiGST'
1405 vinfo( 2)='Switch to write one GST eigenvector per file'
1406 vinfo( 9)='.FALSE.'
1407 vinfo(10)='.TRUE.'
1408 status=def_var(ng, model, ncid, varid, nf90_int, &
1409 & 1, (/0/), aval, vinfo, ncname, &
1410 & setparaccess = .false.)
1411 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1412
1413 vinfo( 1)='LrstGST'
1414 vinfo( 2)='Switch to restart GST analysis'
1415 vinfo( 9)='.FALSE.'
1416 vinfo(10)='.TRUE.'
1417 status=def_var(ng, model, ncid, varid, nf90_int, &
1418 & 1, (/0/), aval, vinfo, ncname, &
1419 & setparaccess = .false.)
1420 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1421
1422 vinfo( 1)='MaxIterGST'
1423 vinfo( 2)='maximum number of GST algorithm iterations'
1424 status=def_var(ng, model, ncid, varid, nf90_int, &
1425 & 1, (/0/), aval, vinfo, ncname, &
1426 & setparaccess = .false.)
1427 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1428
1429 vinfo( 1)='nGST'
1430 vinfo( 2)='number GST iterations between check pointing'
1431 status=def_var(ng, model, ncid, varid, nf90_int, &
1432 & 1, (/0/), aval, vinfo, ncname, &
1433 & setparaccess = .false.)
1434 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1435
1436 vinfo( 1)='NEV'
1437 vinfo( 2)='number Ritz eigenvalues'
1438 status=def_var(ng, model, ncid, varid, nf90_int, &
1439 & 1, (/0/), aval, vinfo, ncname, &
1440 & setparaccess = .false.)
1441 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1442
1443 vinfo( 1)='NCV'
1444 vinfo( 2)='number Ritz eigenvectors generated'
1445 status=def_var(ng, model, ncid, varid, nf90_int, &
1446 & 1, (/0/), aval, vinfo, ncname, &
1447 & setparaccess = .false.)
1448 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1449
1450 vinfo( 1)='Ritz_tol'
1451 vinfo( 2)='relative accuracy of Ritz values'
1452 status=def_var(ng, model, ncid, varid,
nf_tout, &
1453 & 1, (/0/), aval, vinfo, ncname, &
1454 & setparaccess = .false.)
1455 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1456#endif
1457
1458#ifdef DIAGNOSTICS
1459 vinfo( 1)='ntsDIA'
1460 vinfo( 2)= &
1461 & 'starting time-step for accumulation of diagnostic fields'
1462 status=def_var(ng, model, ncid, varid, nf90_int, &
1463 & 1, (/0/), aval, vinfo, ncname, &
1464 & setparaccess = .false.)
1465 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1466
1467 vinfo( 1)='nDIA'
1468 vinfo( 2)='number of time-steps between diagnostic records'
1469 status=def_var(ng, model, ncid, varid, nf90_int, &
1470 & 1, (/0/), aval, vinfo, ncname, &
1471 & setparaccess = .false.)
1472 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1473
1474 vinfo( 1)='ndefDIA'
1475 vinfo( 2)= &
1476 & 'number of time-steps between the creation of diagnostic files'
1477 status=def_var(ng, model, ncid, varid, nf90_int, &
1478 & 1, (/0/), aval, vinfo, ncname, &
1479 & setparaccess = .false.)
1480 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1481#endif
1482
1483#ifdef STATIONS
1484 vinfo( 1)='nSTA'
1485 vinfo( 2)='number of time-steps between stations records'
1486 status=def_var(ng, model, ncid, varid, nf90_int, &
1487 & 1, (/0/), aval, vinfo, ncname, &
1488 & setparaccess = .false.)
1489 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1490#endif
1491
1492#ifdef FOUR_DVAR
1493 vinfo( 1)='Nouter'
1494 vinfo( 2)='number of minimization outer loops'
1495 status=def_var(ng, model, ncid, varid, nf90_int, &
1496 & 1, (/0/), aval, vinfo, ncname, &
1497 & setparaccess = .false.)
1498 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1499
1500 vinfo( 1)='Ninner'
1501 vinfo( 2)='number of minimization inner loops'
1502 status=def_var(ng, model, ncid, varid, nf90_int, &
1503 & 1, (/0/), aval, vinfo, ncname, &
1504 & setparaccess = .false.)
1505 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1506#endif
1507
1508#if defined POWER_LAW && defined SOLVE3D
1509
1510
1511
1512
1513 vinfo( 1)='Falpha'
1514 vinfo( 2)='Power-law shape barotropic filter parameter'
1515 status=def_var(ng, model, ncid, varid,
nf_tout, &
1516 & 1, (/0/), aval, vinfo, ncname, &
1517 & setparaccess = .false.)
1518 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1519
1520 vinfo( 1)='Fbeta'
1521 vinfo( 2)='Power-law shape barotropic filter parameter'
1522 status=def_var(ng, model, ncid, varid,
nf_tout, &
1523 & 1, (/0/), aval, vinfo, ncname, &
1524 & setparaccess = .false.)
1525 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1526
1527 vinfo( 1)='Fgamma'
1528 vinfo( 2)='Power-law shape barotropic filter parameter'
1529 status=def_var(ng, model, ncid, varid,
nf_tout, &
1530 & 1, (/0/), aval, vinfo, ncname, &
1531 & setparaccess = .false.)
1532 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1533#endif
1534
1535
1536
1537#if defined SOLVE3D && defined TS_DIF2
1538 vinfo( 1)='nl_tnu2'
1539 vinfo( 2)='nonlinear model Laplacian mixing coefficient '// &
1540 & 'for tracers'
1541 vinfo( 3)='meter2 second-1'
1542 status=def_var(ng, model, ncid, varid,
nf_type, &
1543 & 1, (/trcdim/), aval, vinfo, ncname, &
1544 & setparaccess = .false.)
1545 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1546
1547# ifdef ADJOINT
1548 vinfo( 1)='ad_tnu2'
1549 vinfo( 2)='adjoint model Laplacian mixing coefficient '// &
1550 & 'for tracers'
1551 vinfo( 3)='meter2 second-1'
1552 status=def_var(ng, model, ncid, varid,
nf_type, &
1553 & 1, (/trcdim/), aval, vinfo, ncname, &
1554 & setparaccess = .false.)
1555 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1556# endif
1557
1558# if defined TANGENT || defined TL_IOMS
1559 vinfo( 1)='tl_tnu2'
1560 vinfo( 2)='tangent linear model Laplacian mixing coefficient '// &
1561 & 'for tracers'
1562 vinfo( 3)='meter2 second-1'
1563 status=def_var(ng, model, ncid, varid,
nf_type, &
1564 & 1, (/trcdim/), aval, vinfo, ncname, &
1565 & setparaccess = .false.)
1566 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1567# endif
1568#endif
1569
1570#if defined SOLVE3D && defined TS_DIF4
1571 vinfo( 1)='nl_tnu4'
1572 vinfo( 2)='nonlinear model biharmonic mixing coefficient '// &
1573 & 'for tracers'
1574 vinfo( 3)='meter4 second-1'
1575 status=def_var(ng, model, ncid, varid,
nf_type, &
1576 & 1, (/trcdim/), aval, vinfo, ncname, &
1577 & setparaccess = .false.)
1578 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1579
1580# ifdef ADJOINT
1581 vinfo( 1)='ad_tnu4'
1582 vinfo( 2)='adjoint model biharmonic mixing coefficient '// &
1583 & 'for tracers'
1584 vinfo( 3)='meter4 second-1'
1585 status=def_var(ng, model, ncid, varid,
nf_type, &
1586 & 1, (/trcdim/), aval, vinfo, ncname, &
1587 & setparaccess = .false.)
1588 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1589# endif
1590
1591# if defined TANGENT || defined TL_IOMS
1592 vinfo( 1)='tl_tnu4'
1593 vinfo( 2)='tangent linear model biharmonic mixing coefficient '// &
1594 & 'for tracers'
1595 vinfo( 3)='meter4 second-1'
1596 status=def_var(ng, model, ncid, varid,
nf_type, &
1597 & 1, (/trcdim/), aval, vinfo, ncname, &
1598 & setparaccess = .false.)
1599 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1600# endif
1601#endif
1602
1603#ifdef UV_VIS2
1604 vinfo( 1)='nl_visc2'
1605 vinfo( 2)='nonlinear model Laplacian mixing coefficient '// &
1606 & 'for momentum'
1607 vinfo( 3)='meter2 second-1'
1608 status=def_var(ng, model, ncid, varid,
nf_type, &
1609 & 1, (/0/), aval, vinfo, ncname, &
1610 & setparaccess = .false.)
1611 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1612
1613# ifdef ADJOINT
1614 vinfo( 1)='ad_visc2'
1615 vinfo( 2)='adjoint model Laplacian mixing coefficient '// &
1616 & 'for momentum'
1617 vinfo( 3)='meter2 second-1'
1618 status=def_var(ng, model, ncid, varid,
nf_type, &
1619 & 1, (/0/), aval, vinfo, ncname, &
1620 & setparaccess = .false.)
1621 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1622# endif
1623
1624# if defined TANGENT || defined TL_IOMS
1625 vinfo( 1)='tl_visc2'
1626 vinfo( 2)='tangent linear model Laplacian mixing coefficient '// &
1627 & 'for momentum'
1628 vinfo( 3)='meter2 second-1'
1629 status=def_var(ng, model, ncid, varid,
nf_type, &
1630 & 1, (/0/), aval, vinfo, ncname, &
1631 & setparaccess = .false.)
1632 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1633# endif
1634#endif
1635
1636#ifdef UV_VIS4
1637 vinfo( 1)='nl_visc4'
1638 vinfo( 2)='nonlinear model biharmonic mixing coefficient '// &
1639 & 'for momentum'
1640 vinfo( 3)='meter4 second-1'
1641 status=def_var(ng, model, ncid, varid,
nf_type, &
1642 & 1, (/0/), aval, vinfo, ncname, &
1643 & setparaccess = .false.)
1644 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1645
1646# ifdef ADJOINT
1647 vinfo( 1)='ad_visc4'
1648 vinfo( 2)='adjoint model biharmonic mixing coefficient '// &
1649 & 'for momentum'
1650 vinfo( 3)='meter4 second-1'
1651 status=def_var(ng, model, ncid, varid,
nf_type, &
1652 & 1, (/0/), aval, vinfo, ncname, &
1653 & setparaccess = .false.)
1654 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1655# endif
1656
1657# if defined TANGENT || defined TL_IOMS
1658 vinfo( 1)='tl_visc4'
1659 vinfo( 2)='tangent linear model biharmonic mixing coefficient '// &
1660 & 'for momentum'
1661 vinfo( 3)='meter4 second-1'
1662 status=def_var(ng, model, ncid, varid,
nf_type, &
1663 & 1, (/0/), aval, vinfo, ncname, &
1664 & setparaccess = .false.)
1665 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1666# endif
1667#endif
1668
1669#if defined SOLVE3D && (defined MY25_MIXING || defined GLS_MIXING)
1670# ifdef TKE_DIF2
1671 vinfo( 1)='tkenu2'
1672 vinfo( 2)='harmonic mixing coefficient for turbulent energy'
1673 vinfo( 3)='meter2 second-1'
1674 status=def_var(ng, model, ncid, varid,
nf_type, &
1675 & 1, (/0/), aval, vinfo, ncname, &
1676 & setparaccess = .false.)
1677 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1678# endif
1679# ifdef TKE_DIF4
1680 vinfo( 1)='tkenu4'
1681 vinfo( 2)='biharmonic mixing coefficient for turbulent energy'
1682 vinfo( 3)='meter4 second-1'
1683 status=def_var(ng, model, ncid,varid,
nf_type, &
1684 & 1, (/0/), aval, vinfo, ncname, &
1685 & setparaccess = .false.)
1686 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1687# endif
1688#endif
1689#if defined UV_VIS2 || defined UV_VIS4
1690 vinfo( 1)='LuvSponge'
1691 vinfo( 2)='horizontal viscosity sponge activation switch'
1692 vinfo( 9)='.FALSE.'
1693 vinfo(10)='.TRUE.'
1694 status=def_var(ng, model, ncid, varid, nf90_int, &
1695 & 1, (/0/), aval, vinfo, ncname, &
1696 & setparaccess = .false.)
1697 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1698#endif
1699#if (defined TS_DIF2 || defined TS_DIF4) && defined SOLVE3D
1700 vinfo( 1)='LtracerSponge'
1701 vinfo( 2)='horizontal diffusivity sponge activation switch'
1702 vinfo( 9)='.FALSE.'
1703 vinfo(10)='.TRUE.'
1704 status=def_var(ng, model, ncid, varid, nf90_int, &
1705 & 1, (/trcdim/), aval, vinfo, ncname, &
1706 & setparaccess = .false.)
1707 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1708#endif
1709#ifdef SOLVE3D
1710
1711
1712
1713 vinfo( 1)='Akt_bak'
1714 vinfo( 2)='background vertical mixing coefficient for tracers'
1715 vinfo( 3)='meter2 second-1'
1716 status=def_var(ng, model, ncid, varid,
nf_type, &
1717 & 1, (/trcdim/), aval, vinfo, ncname, &
1718 & setparaccess = .false.)
1719 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1720
1721 vinfo( 1)='Akv_bak'
1722 vinfo( 2)='background vertical mixing coefficient for momentum'
1723 vinfo( 3)='meter2 second-1'
1724 status=def_var(ng, model, ncid, varid,
nf_type, &
1725 & 1, (/0/), aval, vinfo, ncname, &
1726 & setparaccess = .false.)
1727 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1728
1729# if defined MY25_MIXING || defined GLS_MIXING
1730 vinfo( 1)='Akk_bak'
1731 vinfo( 2)= &
1732 & 'background vertical mixing coefficient for turbulent energy'
1733 vinfo( 3)='meter2 second-1'
1734 status=def_var(ng, model, ncid, varid,
nf_type, &
1735 & 1, (/0/), aval, vinfo, ncname, &
1736 & setparaccess = .false.)
1737 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1738
1739 vinfo( 1)='Akp_bak'
1740 vinfo( 2)= &
1741 & 'background vertical mixing coefficient for length scale'
1742 vinfo( 3)='meter2 second-1'
1743 status=def_var(ng, model, ncid, varid,
nf_type, &
1744 & 1, (/0/), aval, vinfo, ncname, &
1745 & setparaccess = .false.)
1746 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1747# endif
1748
1749# ifdef FORWARD_MIXING
1750
1751
1752
1753# ifdef ADJOINT
1754 vinfo( 1)='ad_Akt_fac'
1755 vinfo( 2)='adjoint model basic state vertical mixing '// &
1756 & 'scale for tracers'
1757 status=def_var(ng, model, ncid, varid,
nf_type, &
1758 & 1, (/trcdim/), aval, vinfo, ncname, &
1759 & setparaccess = .false.)
1760 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1761# endif
1762
1763# if defined TANGENT || defined TL_IOMS
1764 vinfo( 1)='tl_Akt_fac'
1765 vinfo( 2)='tangent linear model basic state vertical mixing '// &
1766 & 'scale for tracers'
1767 status=def_var(ng, model, ncid, varid,
nf_type, &
1768 & 1, (/trcdim/), aval, vinfo, ncname, &
1769 & setparaccess = .false.)
1770 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1771# endif
1772
1773# ifdef ADJOINT
1774 vinfo( 1)='ad_Akv_fac'
1775 vinfo( 2)='adjoint model basic state vertical mixing '// &
1776 & 'scale for momentum'
1777 status=def_var(ng, model, ncid, varid,
nf_type, &
1778 & 1, (/0/), aval, vinfo, ncname, &
1779 & setparaccess = .false.)
1780 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1781# endif
1782
1783# if defined TANGENT || defined TL_IOMS
1784 vinfo( 1)='tl_Akv_fac'
1785 vinfo( 2)='tangent linear model basic state vertical mixing '// &
1786 & 'scale for momentum'
1787 status=def_var(ng, model, ncid, varid,
nf_type, &
1788 & 1, (/0/), aval, vinfo, ncname, &
1789 & setparaccess = .false.)
1790 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1791# endif
1792# endif
1793#endif
1794
1795
1796
1797 vinfo( 1)='rdrg'
1798 vinfo( 2)='linear drag coefficient'
1799 vinfo( 3)='meter second-1'
1800 status=def_var(ng, model, ncid, varid,
nf_type, &
1801 & 1, (/0/), aval, vinfo, ncname, &
1802 & setparaccess = .false.)
1803 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1804
1805 vinfo( 1)='rdrg2'
1806 vinfo( 2)='quadratic drag coefficient'
1807 status=def_var(ng, model, ncid, varid,
nf_type, &
1808 & 1, (/0/), aval, vinfo ,ncname, &
1809 & setparaccess = .false.)
1810 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1811
1812#ifdef SOLVE3D
1813 vinfo( 1)='Zob'
1814 vinfo( 2)='bottom roughness'
1815 vinfo( 3)='meter'
1816 status=def_var(ng, model, ncid, varid,
nf_type, &
1817 & 1, (/0/), aval, vinfo, ncname, &
1818 & setparaccess = .false.)
1819 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1820
1821 vinfo( 1)='Zos'
1822 vinfo( 2)='surface roughness'
1823 vinfo( 3)='meter'
1824 status=def_var(ng, model, ncid, varid,
nf_type, &
1825 & 1, (/0/), aval, vinfo, ncname, &
1826 & setparaccess = .false.)
1827 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1828#endif
1829#if defined SOLVE3D && defined GLS_MIXING
1830
1831
1832
1833 vinfo( 1)='gls_p'
1834 vinfo( 2)='stability exponent'
1835 status=def_var(ng, model, ncid, varid,
nf_type, &
1836 & 1, (/0/), aval, vinfo, ncname, &
1837 & setparaccess = .false.)
1838 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1839
1840 vinfo( 1)='gls_m'
1841 vinfo( 2)='turbulent kinetic energy exponent'
1842 status=def_var(ng, model, ncid, varid,
nf_type, &
1843 & 1, (/0/), aval, vinfo, ncname, &
1844 & setparaccess = .false.)
1845 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1846
1847 vinfo( 1)='gls_n'
1848 vinfo( 2)='turbulent length scale exponent'
1849 status=def_var(ng, model, ncid, varid,
nf_type, &
1850 & 1, (/0/), aval, vinfo, ncname, &
1851 & setparaccess = .false.)
1852 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1853
1854 vinfo( 1)='gls_cmu0'
1855 vinfo( 2)='stability coefficient'
1856 status=def_var(ng, model, ncid, varid,
nf_type, &
1857 & 1, (/0/), aval, vinfo, ncname, &
1858 & setparaccess = .false.)
1859 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1860
1861 vinfo( 1)='gls_c1'
1862 vinfo( 2)='shear production coefficient'
1863 status=def_var(ng, model, ncid, varid,
nf_type, &
1864 & 1, (/0/), aval, vinfo, ncname, &
1865 & setparaccess = .false.)
1866 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1867
1868 vinfo( 1)='gls_c2'
1869 vinfo( 2)='dissipation coefficient'
1870 status=def_var(ng, model, ncid, varid,
nf_type, &
1871 & 1, (/0/), aval, vinfo, ncname, &
1872 & setparaccess = .false.)
1873 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1874
1875 vinfo( 1)='gls_c3m'
1876 vinfo( 2)='buoyancy production coefficient (minus)'
1877 status=def_var(ng, model, ncid, varid,
nf_type, &
1878 & 1, (/0/), aval, vinfo, ncname, &
1879 & setparaccess = .false.)
1880 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1881
1882 vinfo( 1)='gls_c3p'
1883 vinfo( 2)='buoyancy production coefficient (plus)'
1884 status=def_var(ng, model, ncid, varid,
nf_type, &
1885 & 1, (/0/), aval, vinfo, ncname, &
1886 & setparaccess = .false.)
1887 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1888
1889 vinfo( 1)='gls_sigk'
1890 vinfo( 2)='constant Schmidt number for TKE'
1891 status=def_var(ng, model, ncid, varid,
nf_type, &
1892 & 1, (/0/), aval, vinfo, ncname, &
1893 & setparaccess = .false.)
1894 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1895
1896 vinfo( 1)='gls_sigp'
1897 vinfo( 2)='constant Schmidt number for PSI'
1898 status=def_var(ng, model, ncid, varid,
nf_type, &
1899 & 1, (/0/), aval, vinfo, ncname, &
1900 & setparaccess = .false.)
1901 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1902
1903 vinfo( 1)='gls_Kmin'
1904 vinfo( 2)='minimum value of specific turbulent kinetic energy'
1905 status=def_var(ng, model, ncid, varid,
nf_type, &
1906 & 1, (/0/), aval, vinfo, ncname, &
1907 & setparaccess = .false.)
1908 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1909
1910 vinfo( 1)='gls_Pmin'
1911 vinfo( 2)='minimum Value of dissipation'
1912 status=def_var(ng, model, ncid, varid,
nf_type, &
1913 & 1, (/0/), aval, vinfo, ncname, &
1914 & setparaccess = .false.)
1915 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1916
1917 vinfo( 1)='Charnok_alpha'
1918 vinfo( 2)='Charnock factor for surface roughness'
1919 status=def_var(ng, model, ncid, varid,
nf_type, &
1920 & 1, (/0/), aval, vinfo, ncname, &
1921 & setparaccess = .false.)
1922 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1923
1924 vinfo( 1)='Zos_hsig_alpha'
1925 vinfo( 2)='wave amplitude factor for surface roughness'
1926 status=def_var(ng, model, ncid, varid,
nf_type, &
1927 & 1, (/0/), aval, vinfo, ncname, &
1928 & setparaccess = .false.)
1929 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1930
1931 vinfo( 1)='sz_alpha'
1932 vinfo( 2)='surface flux from wave dissipation'
1933 status=def_var(ng, model, ncid, varid,
nf_type, &
1934 & 1, (/0/), aval, vinfo, ncname, &
1935 & setparaccess = .false.)
1936 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1937
1938 vinfo( 1)='CrgBan_cw'
1939 vinfo( 2)='surface flux due to Craig and Banner wave breaking'
1940 status=def_var(ng, model, ncid, varid,
nf_type, &
1941 & 1, (/0/), aval, vinfo, ncname, &
1942 & setparaccess = .false.)
1943 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1944#endif
1945#ifdef WEC
1946 vinfo( 1)='wec_alpha'
1947 vinfo( 2)='WEC wave dissipation action scale'
1948 vinfo( 9)='all goes to breaking and none to roller'
1949 vinfo(10)='all goes to roller and none to breaking'
1950 status=def_var(ng, model, ncid, varid,
nf_type, &
1951 & 1, (/0/), aval, vinfo, ncname, &
1952 & setparaccess = .false.)
1953 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1954#endif
1955
1956
1957
1958 vinfo( 1)='Znudg'
1959 vinfo( 2)='free-surface nudging/relaxation inverse time scale'
1960 vinfo( 3)='day-1'
1961 status=def_var(ng, model, ncid, varid,
nf_tout, &
1962 & 1, (/0/), aval, vinfo, ncname, &
1963 & setparaccess = .false.)
1964 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1965
1966 vinfo( 1)='M2nudg'
1967 vinfo( 2)='2D momentum nudging/relaxation inverse time scale'
1968 vinfo( 3)='day-1'
1969 status=def_var(ng, model, ncid, varid,
nf_tout, &
1970 & 1, (/0/), aval, vinfo, ncname, &
1971 & setparaccess = .false.)
1972 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1973
1974#ifdef SOLVE3D
1975 vinfo( 1)='M3nudg'
1976 vinfo( 2)='3D momentum nudging/relaxation inverse time scale'
1977 vinfo( 3)='day-1'
1978 status=def_var(ng, model, ncid, varid,
nf_tout, &
1979 & 1, (/0/), aval, vinfo, ncname, &
1980 & setparaccess = .false.)
1981 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1982
1983 vinfo( 1)='Tnudg'
1984 vinfo( 2)='Tracers nudging/relaxation inverse time scale'
1985 vinfo( 3)='day-1'
1986 status=def_var(ng, model, ncid, varid,
nf_tout, &
1987 & 1, (/trcdim/), aval, vinfo, ncname, &
1988 & setparaccess = .false.)
1989 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
1990#endif
1991
1992#ifndef DEBUGGING
1993
1994
1995
1996 IF (nudgingcoeff(ng)) THEN
1997 vinfo( 1)='FSobc_in'
1998 vinfo( 2)='free-surface inflow, nudging inverse time scale'
1999 vinfo( 3)='second-1'
2000 status=def_var(ng, model, ncid, varid,
nf_tout, &
2001 & 1, (/brydim/), aval, vinfo, ncname, &
2002 & setparaccess = .false.)
2003 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2004
2005 vinfo( 1)='FSobc_out'
2006 vinfo( 2)='free-surface outflow, nudging inverse time scale'
2007 vinfo( 3)='second-1'
2008 status=def_var(ng, model, ncid, varid,
nf_tout, &
2009 & 1, (/brydim/), aval, vinfo, ncname, &
2010 & setparaccess = .false.)
2011 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2012
2013 vinfo( 1)='M2obc_in'
2014 vinfo( 2)='2D momentum inflow, nudging inverse time scale'
2015 vinfo( 3)='second-1'
2016 status=def_var(ng, model, ncid, varid,
nf_tout, &
2017 & 1, (/brydim/), aval, vinfo, ncname, &
2018 & setparaccess = .false.)
2019 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2020
2021 vinfo( 1)='M2obc_out'
2022 vinfo( 2)='2D momentum outflow, nudging inverse time scale'
2023 vinfo( 3)='second-1'
2024 status=def_var(ng, model, ncid, varid,
nf_tout, &
2025 & 1, (/brydim/), aval, vinfo, ncname, &
2026 & setparaccess = .false.)
2027 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2028
2029# ifdef SOLVE3D
2030 vinfo( 1)='Tobc_in'
2031 vinfo( 2)='tracers inflow, nudging inverse time scale'
2032 vinfo( 3)='second-1'
2033 status=def_var(ng, model, ncid, varid,
nf_tout, &
2034 & 2, tbrydim, aval, vinfo, ncname, &
2035 & setparaccess = .false.)
2036 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2037
2038 vinfo( 1)='Tobc_out'
2039 vinfo( 2)='tracers outflow, nudging inverse time scale'
2040 vinfo( 3)='second-1'
2041 status=def_var(ng, model, ncid, varid,
nf_tout, &
2042 & 2, tbrydim, aval, vinfo, ncname, &
2043 & setparaccess = .false.)
2044 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2045
2046 vinfo( 1)='M3obc_in'
2047 vinfo( 2)='3D momentum inflow, nudging inverse time scale'
2048 vinfo( 3)='second-1'
2049 status=def_var(ng, model, ncid, varid,
nf_tout, &
2050 & 1, (/brydim/), aval, vinfo, ncname, &
2051 & setparaccess = .false.)
2052 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2053
2054 vinfo( 1)='M3obc_out'
2055 vinfo( 2)='3D momentum outflow, nudging inverse time scale'
2056 vinfo( 3)='second-1'
2057 status=def_var(ng, model, ncid, varid,
nf_tout, &
2058 & 1, (/brydim/), aval, vinfo, ncname, &
2059 & setparaccess = .false.)
2060 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2061# endif
2062 END IF
2063#endif
2064
2065
2066
2067 vinfo( 1)='rho0'
2068 vinfo( 2)='mean density used in Boussinesq approximation'
2069 vinfo( 3)='kilogram meter-3'
2070 status=def_var(ng, model, ncid, varid,
nf_type, &
2071 & 1, (/0/), aval, vinfo, ncname, &
2072 & setparaccess = .false.)
2073 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2074
2075#if defined SOLVE3D && defined PROPAGATOR
2076 vinfo( 1)='bvf_bak'
2077 vinfo( 2)='background Brunt-Vaisala frequency'
2078 vinfo( 3)='second-2'
2079 status=def_var(ng, model, ncid, varid,
nf_type, &
2080 & 1, (/0/), aval, vinfo, ncname, &
2081 & setparaccess = .false.)
2082 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2083#endif
2084
2085#if defined SOLVE3D && \
2086 (
2087 vinfo( 1)='R0'
2088 vinfo( 2)='background density used in linear equation of state'
2089 vinfo( 3)='kilogram meter-3'
2090 status=def_var(ng, model, ncid, varid,
nf_type, &
2091 & 1, (/0/), aval, vinfo, ncname, &
2092 & setparaccess = .false.)
2093 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2094
2095 vinfo( 1)='Tcoef'
2096 vinfo( 2)='thermal expansion coefficient'
2097 vinfo( 3)='Celsius-1'
2098 status=def_var(ng, model, ncid, varid,
nf_type, &
2099 & 1, (/0/), aval, vinfo, ncname, &
2100 & setparaccess = .false.)
2101 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2102
2103 vinfo( 1)='Scoef'
2104 vinfo( 2)='Saline contraction coefficient'
2105 status=def_var(ng, model, ncid, varid,
nf_type, &
2106 & 1, (/0/), aval, vinfo, ncname, &
2107 & setparaccess = .false.)
2108 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2109#endif
2110#ifdef SOLVE3D
2111
2112
2113
2114# ifdef BODYFORCE
2115 vinfo( 1)='levsfrc'
2116 vinfo( 2)='shallowest level for body-force stress'
2117 status=def_var(ng, model, ncid, varid, nf90_int, &
2118 & 1, (/0/), aval, vinfo, ncname, &
2119 & setparaccess = .false.)
2120 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2121
2122 vinfo( 1)='levbfrc'
2123 vinfo( 2)='deepest level for body-force stress'
2124 status=def_var(ng, model, ncid, varid, nf90_int, &
2125 & 1, (/0/), aval, vinfo, ncname, &
2126 & setparaccess = .false.)
2127 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2128# endif
2129#endif
2130
2131
2132
2133 vinfo( 1)='gamma2'
2134 vinfo( 2)='slipperiness parameter'
2135 status=def_var(ng, model, ncid, varid,
nf_type, &
2136 & 1, (/0/), aval, vinfo, ncname, &
2137 & setparaccess = .false.)
2138 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2139
2140
2141
2142
2143
2144 vinfo( 1)='LuvSrc'
2145 vinfo( 2)='momentum point sources and sink activation switch'
2146 vinfo( 9)='.FALSE.'
2147 vinfo(10)='.TRUE.'
2148 status=def_var(ng, model, ncid, varid, nf90_int, &
2149 & 1, (/0/), aval, vinfo, ncname, &
2150 & setparaccess = .false.)
2151 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2152
2153 vinfo( 1)='LwSrc'
2154 vinfo( 2)='mass point sources and sink activation switch'
2155 vinfo( 9)='.FALSE.'
2156 vinfo(10)='.TRUE.'
2157 status=def_var(ng, model, ncid, varid, nf90_int, &
2158 & 1, (/0/), aval, vinfo, ncname, &
2159 & setparaccess = .false.)
2160 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2161
2162#ifdef SOLVE3D
2163
2164
2165
2166
2167 vinfo( 1)='LtracerSrc'
2168 vinfo( 2)='tracer point sources and sink activation switch'
2169 vinfo( 9)='.FALSE.'
2170 vinfo(10)='.TRUE.'
2171 status=def_var(ng, model, ncid, varid, nf90_int, &
2172 & 1, (/trcdim/), aval, vinfo, ncname, &
2173 & setparaccess = .false.)
2174 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2175#endif
2176
2177
2178
2179 vinfo( 1)='LsshCLM'
2180 vinfo( 2)='sea surface height climatology processing switch'
2181 vinfo( 9)='.FALSE.'
2182 vinfo(10)='.TRUE.'
2183 status=def_var(ng, model, ncid, varid, nf90_int, &
2184 & 1, (/0/), aval, vinfo, ncname, &
2185 & setparaccess = .false.)
2186 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2187
2188 vinfo( 1)='Lm2CLM'
2189 vinfo( 2)='2D momentum climatology processing switch'
2190 vinfo( 9)='.FALSE.'
2191 vinfo(10)='.TRUE.'
2192 status=def_var(ng, model, ncid, varid, nf90_int, &
2193 & 1, (/0/), aval, vinfo, ncname, &
2194 & setparaccess = .false.)
2195 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2196
2197#ifdef SOLVE3D
2198 vinfo( 1)='Lm3CLM'
2199 vinfo( 2)='3D momentum climatology processing switch'
2200 vinfo( 9)='.FALSE.'
2201 vinfo(10)='.TRUE.'
2202 status=def_var(ng, model, ncid, varid, nf90_int, &
2203 & 1, (/0/), aval, vinfo, ncname, &
2204 & setparaccess = .false.)
2205 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2206
2207 vinfo( 1)='LtracerCLM'
2208 vinfo( 2)='tracer climatology processing switch'
2209 vinfo( 9)='.FALSE.'
2210 vinfo(10)='.TRUE.'
2211 status=def_var(ng, model, ncid, varid, nf90_int, &
2212 & 1, (/trcdim/), aval, vinfo, ncname, &
2213 & setparaccess = .false.)
2214 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2215#endif
2216
2217
2218
2219 vinfo( 1)='LnudgeM2CLM'
2220 vinfo( 2)='2D momentum climatology nudging activation switch'
2221 vinfo( 9)='.FALSE.'
2222 vinfo(10)='.TRUE.'
2223 status=def_var(ng, model, ncid, varid, nf90_int, &
2224 & 1, (/0/), aval, vinfo, ncname, &
2225 & setparaccess = .false.)
2226 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2227#ifdef SOLVE3D
2228
2229 vinfo( 1)='LnudgeM3CLM'
2230 vinfo( 2)='3D momentum climatology nudging activation switch'
2231 vinfo( 9)='.FALSE.'
2232 vinfo(10)='.TRUE.'
2233 status=def_var(ng, model, ncid, varid, nf90_int, &
2234 & 1, (/0/), aval, vinfo, ncname, &
2235 & setparaccess = .false.)
2236 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2237
2238 vinfo( 1)='LnudgeTCLM'
2239 vinfo( 2)='tracer climatology nudging activation switch'
2240 vinfo( 9)='.FALSE.'
2241 vinfo(10)='.TRUE.'
2242 status=def_var(ng, model, ncid, varid, nf90_int, &
2243 & 1, (/trcdim/), aval, vinfo, ncname, &
2244 & setparaccess = .false.)
2245 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2246#endif
2247#ifdef FOUR_DVAR
2248
2249
2250
2251# ifdef ADJUST_STFLUX
2252 vinfo( 1)='Lstflux'
2253 vinfo( 2)='surface tracer fluxes adjustment switch'
2254 vinfo( 9)='.FALSE.'
2255 vinfo(10)='.TRUE.'
2256 status=def_var(ng, model, ncid, varid, nf90_int, &
2257 & 1, (/trcdim/), aval, vinfo, ncname, &
2258 & setparaccess = .false.)
2259 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2260# endif
2261# ifdef ADJUST_BOUNDARY
2262 vinfo( 1)='Lobc'
2263 vinfo( 2)='open boundary conditions adjustment switch'
2264 vinfo( 9)='.FALSE.'
2265 vinfo(10)='.TRUE.'
2266 status=def_var(ng, model, ncid, varid, nf90_int, &
2267 & 2, (/brydim, statedim/), aval, vinfo, ncname, &
2268 & setparaccess = .false.)
2269 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2270# endif
2271# ifndef I4DVAR_ANA_SENSITIVITY
2272 vinfo( 1)='LhessianEV'
2273 vinfo( 2)='switch to compute Hessian eigenvectors'
2274 vinfo( 9)='.FALSE.'
2275 vinfo(10)='.TRUE.'
2276 status=def_var(ng, model, ncid, varid, nf90_int, &
2277 & 1, (/0/), aval, vinfo, ncname, &
2278 & setparaccess = .false.)
2279 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2280
2281# ifdef WEAK_CONSTRAINT
2282 vinfo( 1)='LhotStart'
2283 vinfo( 2)='switch for hot start of subsequent outer loops'
2284 vinfo( 9)='.FALSE.'
2285 vinfo(10)='.TRUE.'
2286 status=def_var(ng, model, ncid, varid, nf90_int, &
2287 & 1, (/0/), aval, vinfo, ncname, &
2288 & setparaccess = .false.)
2289 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2290# endif
2291
2292 vinfo( 1)='Lprecond'
2293 vinfo( 2)='switch for conjugate gradient preconditioning'
2294 vinfo( 9)='.FALSE.'
2295 vinfo(10)='.TRUE.'
2296 status=def_var(ng, model, ncid, varid, nf90_int, &
2297 & 1, (/0/), aval, vinfo, ncname, &
2298 & setparaccess = .false.)
2299 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2300
2301 vinfo( 1)='Lritz'
2302 vinfo( 2)='switch for Ritz limited-memory preconditioning'
2303 vinfo( 9)='.FALSE.'
2304 vinfo(10)='.TRUE.'
2305 status=def_var(ng, model, ncid, varid, nf90_int, &
2306 & 1, (/0/), aval, vinfo, ncname, &
2307 & setparaccess = .false.)
2308 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2309
2310# ifdef WEAK_CONSTRAINT
2311 IF (lprecond.and.(nritzev.gt.0)) THEN
2312 vinfo( 1)='NritzEV'
2313 vinfo( 2)='number of preconditioning eigenpairs to use'
2314 status=def_var(ng, model, ncid, varid, nf90_int, &
2315 & 1, (/0/), aval, vinfo, ncname, &
2316 & setparaccess = .false.)
2317 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2318 END IF
2319# endif
2320# endif
2321# if defined POSTERIOR_EOFS && defined WEAK_CONSTRAINT
2322 vinfo( 1)='NpostI'
2323 vinfo( 2)='number of Lanczos iterations in posterior analysis'
2324 status=def_var(ng, model, ncid, varid, nf90_int, &
2325 & 1, (/0/), aval, vinfo, ncname, &
2326 & setparaccess = .false.)
2327 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2328# endif
2329# if defined ARRAY_MODES || \
2330 defined i4dvar_ana_sensitivity || \
2331 defined rbl4dvar_ana_sensitivity || \
2332 defined rbl4dvar_fct_sensitivity || \
2333 defined r4dvar_ana_sensitivity
2334 vinfo( 1)='Nimpact'
2335 vinfo( 2)='Observations impact/sensitivity outer loop to use'
2336 status=def_var(ng, model, ncid, varid, nf90_int, &
2337 & 1, (/0/), aval, vinfo, ncname, &
2338 & setparaccess = .false.)
2339 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2340# endif
2341# ifndef I4DVAR_ANA_SENSITIVITY
2342 vinfo( 1)='GradErr'
2343 vinfo( 2)='Upper bound on relative error of the gradient'
2344 status=def_var(ng, model, ncid, varid,
nf_type, &
2345 & 1, (/0/), aval, vinfo, ncname, &
2346 & setparaccess = .false.)
2347 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2348
2349 vinfo( 1)='HevecErr'
2350 vinfo( 2)='Accuracy required for Hessian eigenvectors'
2351 status=def_var(ng, model, ncid, varid,
nf_type, &
2352 & 1, (/0/), aval, vinfo, ncname, &
2353 & setparaccess = .false.)
2354 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2355# endif
2356
2357 vinfo( 1)='Nmethod'
2358 vinfo( 2)='background error covariance normalization method'
2359 vinfo( 9)='exact'
2360 vinfo(10)='randomization'
2361 status=def_var(ng, model, ncid, varid, nf90_int, &
2362 & 1, (/0/), aval, vinfo, ncname, &
2363 & setparaccess = .false.)
2364 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2365
2366 vinfo( 1)='Rscheme'
2367 vinfo( 2)='Random number generation scheme'
2368 vinfo( 9)='intrisic_randon_number'
2369 vinfo(10)='Gaussian_distributed_deviates'
2370 status=def_var(ng, model, ncid, varid, nf90_int, &
2371 & 1, (/0/), aval, vinfo, ncname, &
2372 & setparaccess = .false.)
2373 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2374
2375 vinfo( 1)='Nrandom'
2376 vinfo( 2)='number of randomization iterations'
2377 status=def_var(ng, model, ncid, varid, nf90_int, &
2378 & 1, (/0/), aval, vinfo, ncname, &
2379 & setparaccess = .false.)
2380 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2381
2382 vinfo( 1)='Hgamma'
2383 vinfo( 2)='initial conditions error covariance '// &
2384 & 'horizontal convolution time-step stability factor'
2385 status=def_var(ng, model, ncid, varid,
nf_type, &
2386 & 1, (/0/), aval, vinfo, ncname, &
2387 & setparaccess = .false.)
2388 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2389
2390# ifdef WEAK_CONSTRAINT
2391 vinfo( 1)='HgammaM'
2392 vinfo( 2)='model error covariance '// &
2393 & 'horizontal convolution time-step stability factor'
2394 status=def_var(ng, model, ncid, varid,
nf_type, &
2395 & 1, (/0/), aval, vinfo, ncname, &
2396 & setparaccess = .false.)
2397 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2398# endif
2399
2400# ifdef ADJUST_BOUNDARY
2401 vinfo( 1)='HgammaB'
2402 vinfo( 2)='open boundary conditions error covariance '// &
2403 & 'horizontal convolution time-step stability factor'
2404 status=def_var(ng, model, ncid, varid,
nf_type, &
2405 & 1, (/0/), aval, vinfo, ncname, &
2406 & setparaccess = .false.)
2407 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2408# endif
2409
2410# ifdef ADJUST_STFLUX
2411 vinfo( 1)='HgammaF'
2412 vinfo( 2)='surface forcing error covariance '// &
2413 & 'horizontal convolution time-step stability factor'
2414 status=def_var(ng, model, ncid, varid,
nf_type, &
2415 & 1, (/0/), aval, vinfo, ncname, &
2416 & setparaccess = .false.)
2417 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2418# endif
2419
2420# ifdef SOLVE3D
2421 vinfo( 1)='Vgamma'
2422 vinfo( 2)='initial conditions error covariance '// &
2423 & 'vertical convolution time-step stability factor'
2424 status=def_var(ng, model, ncid, varid,
nf_type, &
2425 & 1, (/0/), aval, vinfo, ncname, &
2426 & setparaccess = .false.)
2427 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2428
2429# ifdef WEAK_CONSTRAINT
2430 vinfo( 1)='VgammaM'
2431 vinfo( 2)='model error covariance '// &
2432 & 'vertical convolution time-step stability factor'
2433 status=def_var(ng, model, ncid, varid,
nf_type, &
2434 & 1, (/0/), aval, vinfo, ncname, &
2435 & setparaccess = .false.)
2436 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2437# endif
2438
2439# ifdef ADJUST_BOUNDARY
2440 vinfo( 1)='VgammaB'
2441 vinfo( 2)='open boundary conditions error covariance '// &
2442 & 'vertical convolution time-step stability factor'
2443 status=def_var(ng, model, ncid, varid,
nf_type, &
2444 & 1, (/0/), aval, vinfo, ncname, &
2445 & setparaccess = .false.)
2446 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2447# endif
2448# endif
2449
2450 vinfo( 1)='Hdecay'
2451 vinfo( 2)='initial conditions error covariance '// &
2452 & 'horizontal decorrelation scale'
2453 vinfo( 3)='meter'
2454 status=def_var(ng, model, ncid, varid,
nf_type, &
2455 & 1, (/statedim/), aval, vinfo, ncname, &
2456 & setparaccess = .false.)
2457 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2458
2459# ifdef SOLVE3D
2460 vinfo( 1)='Vdecay'
2461 vinfo( 2)='initial conditions error covariance '// &
2462 & 'vertical decorrelation scale'
2463 vinfo( 3)='meter'
2464 status=def_var(ng, model, ncid, varid,
nf_type, &
2465 & 1, (/statedim/), aval, vinfo, ncname, &
2466 & setparaccess = .false.)
2467 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2468# endif
2469
2470 IF (nsa.eq.2) THEN
2471 vinfo( 1)='HdecayM'
2472 vinfo( 2)='model error covariance ' // &
2473 & 'horizontal decorrelation scale'
2474 vinfo( 3)='meter'
2475 status=def_var(ng, model, ncid, varid,
nf_type, &
2476 & 1, (/statedim/), aval, vinfo, ncname, &
2477 & setparaccess = .false.)
2478 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2479
2480# ifdef SOLVE3D
2481 vinfo( 1)='VdecayM'
2482 vinfo( 2)='model error covariance '// &
2483 & 'vertical decorrelation scale'
2484 vinfo( 3)='meter'
2485 status=def_var(ng, model, ncid, varid,
nf_type, &
2486 & 1, (/statedim/), aval, vinfo, ncname, &
2487 & setparaccess = .false.)
2488 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2489# endif
2490 END IF
2491
2492# ifdef ADJUST_BOUNDARY
2493 vinfo( 1)='HdecayB'
2494 vinfo( 2)='open boundary conditions error covariance '// &
2495 & 'horizontal decorrelation scale'
2496 vinfo( 3)='meter'
2497 status=def_var(ng, model, ncid, varid,
nf_type, &
2498 & 2, (/statedim, brydim/), aval, vinfo, ncname, &
2499 & setparaccess = .false.)
2500 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2501
2502# ifdef SOLVE3D
2503 vinfo( 1)='VdecayB'
2504 vinfo( 2)='open boundary conditions error covariance '// &
2505 & 'vertical decorrelation scale'
2506 vinfo( 3)='meter'
2507 status=def_var(ng, model, ncid, varid,
nf_type, &
2508 & 2, (/statedim, brydim/), aval, vinfo, ncname, &
2509 & setparaccess = .false.)
2510 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2511# endif
2512# endif
2513
2514# ifdef RPM_RELAXATION
2515 vinfo( 1)='tl_M2diff'
2516 vinfo( 2)='RPM 2D momentum diffusive relaxation coefficient'
2517 vinfo( 3)='meter2 second-1'
2518 status=def_var(ng, model, ncid, varid,
nf_type, &
2519 & 1, (/0/), aval, vinfo, ncname, &
2520 & setparaccess = .false.)
2521 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2522
2523# ifdef SOLVE3D
2524 vinfo( 1)='tl_M3diff'
2525 vinfo( 2)='RPM 3D momentum diffusive relaxation coefficient'
2526 vinfo( 3)='meter2 second-1'
2527 status=def_var(ng, model, ncid, varid,
nf_type, &
2528 & 1, (/0/), aval, vinfo, ncname, &
2529 & setparaccess = .false.)
2530 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2531
2532 vinfo( 1)='tl_Tdiff'
2533 vinfo( 2)='RPM tracers diffusive relaxation coefficients'
2534 vinfo( 3)='meter2 second-1'
2535 status=def_var(ng, model, ncid, varid,
nf_type, &
2536 & 1, (/trcdim/), aval, vinfo, ncname, &
2537 & setparaccess = .false.)
2538 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2539# endif
2540# endif
2541
2542# ifdef BALANCE_OPERATOR
2543# ifdef ZETA_ELLIPTIC
2544 vinfo( 1)='Nbico'
2545 vinfo( 2)='number of iterations in SSH elliptic equation'
2546 status=def_var(ng, model, ncid, varid, nf90_int, &
2547 & 1, (/0/), aval, vinfo, ncname, &
2548 & setparaccess = .false.)
2549 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2550# endif
2551
2552 vinfo( 1)='Lbalance'
2553 vinfo( 2)='switches for state variables included as '// &
2554 'constraint in the error covariance balance operator'
2555 vinfo( 9)='.FALSE.'
2556 vinfo(10)='.TRUE.'
2557 status=def_var(ng, model, ncid, varid, nf90_int, &
2558 & 1, (/statedim/), aval, vinfo, ncname, &
2559 & setparaccess = .false.)
2560 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2561
2562 vinfo( 1)='LNM_flag'
2563 vinfo( 2)='balance operator level of no motion flag'
2564 vinfo( 9)='integrate from bottom to surface,'
2565 vinfo(10)='integrate from LNM_depth to surface'
2566 status=def_var(ng, model, ncid, varid, nf90_int, &
2567 & 1, (/0/), aval, vinfo, ncname, &
2568 & setparaccess = .false.)
2569 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2570
2571 vinfo( 1)='LNM_depth'
2572 vinfo( 2)='balance operator level of no motion depth'
2573 vinfo( 3)='meter'
2574 status=def_var(ng, model, ncid, varid,
nf_type, &
2575 & 1, (/0/), aval, vinfo, ncname, &
2576 & setparaccess = .false.)
2577 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2578
2579 vinfo( 1)='dTdz_min'
2580 vinfo( 2)='minimum dT/dz value used in balaced salinity'
2581 vinfo( 3)='Celsius meter-1'
2582 status=def_var(ng, model, ncid, varid,
nf_type, &
2583 & 1, (/0/), aval, vinfo, ncname, &
2584 & setparaccess = .false.)
2585 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2586
2587 vinfo( 1)='ml_depth'
2588 vinfo( 2)='mixed layer depth used in balanced salinity'
2589 vinfo( 3)='meter'
2590 status=def_var(ng, model, ncid, varid,
nf_type, &
2591 & 1, (/0/), aval, vinfo, ncname, &
2592 & setparaccess = .false.)
2593 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2594# endif
2595
2596# ifdef STD_MODEL
2597
2598
2599
2600 vinfo( 1)='Sigma_max'
2601 vinfo( 2)='background standard deviation, '// &
2602 & 'maximum value'
2603 vinfo( 3)='state variable units'
2604 status=def_var(ng, model, ncid, varid,
nf_type, &
2605 & 1, (/statedim/), aval, vinfo, ncname, &
2606 & setparaccess = .false.)
2607 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2608
2609 vinfo( 1)='Sigma_ml'
2610 vinfo( 2)='background standard deviation, '// &
2611 & 'maximum value at mixed layer'
2612 vinfo( 3)='state variable units'
2613 status=def_var(ng, model, ncid, varid,
nf_type, &
2614 & 1, (/statedim/), aval, vinfo, ncname, &
2615 & setparaccess = .false.)
2616 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2617
2618 vinfo( 1)='Sigma_do'
2619 vinfo( 2)='background standard deviation, '// &
2620 & 'maximum value in deep ocean'
2621 vinfo( 3)='state variable units'
2622 status=def_var(ng, model, ncid, varid,
nf_type, &
2623 & 1, (/statedim/), aval, vinfo, ncname, &
2624 & setparaccess = .false.)
2625 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2626
2627 vinfo( 1)='Sigma_dz'
2628 vinfo( 2)='background standard deviation, '// &
2629 & 'profile vertical displacement'
2630 vinfo( 3)='meter'
2631 status=def_var(ng, model, ncid, varid,
nf_type, &
2632 & 1, (/statedim/), aval, vinfo, ncname, &
2633 & setparaccess = .false.)
2634 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2635
2636# ifndef COMPUTE_MLD
2637 vinfo( 1)='mld_uniform'
2638 vinfo( 2)='constast mixed-layer depth value'
2639 vinfo( 3)='meter'
2640 status=def_var(ng, model, ncid, varid,
nf_type, &
2641 & 1, (/0/), aval, vinfo, ncname, &
2642 & setparaccess = .false.)
2643 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2644# endif
2645# endif
2646#endif
2647
2648#if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
2649 defined opt_observations || defined sensitivity_4dvar || \
2650 defined so_semi
2651
2652
2653
2654 vinfo( 1)='Lzeta'
2655 vinfo( 2)='adjoint sensitivity on free-surface'
2656 vinfo( 9)='off'
2657 vinfo(10)='on'
2658 status=def_var(ng, model, ncid, varid, nf90_int, &
2659 & 1, (/0/), aval, vinfo, ncname, &
2660 & setparaccess = .false.)
2661 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2662
2663 vinfo( 1)='Lubar'
2664 vinfo( 2)='adjoint sensitivity on 2D U-momentum'
2665 vinfo( 9)='off'
2666 vinfo(10)='on'
2667 status=def_var(ng, model, ncid, varid, nf90_int, &
2668 & 1, (/0/), aval, vinfo, ncname, &
2669 & setparaccess = .false.)
2670 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2671
2672 vinfo( 1)='Lvbar'
2673 vinfo( 2)='adjoint sensitivity on 2D V-momentum'
2674 vinfo( 9)='off'
2675 vinfo(10)='on'
2676 status=def_var(ng, model, ncid, varid, nf90_int, &
2677 & 1, (/0/), aval, vinfo, ncname, &
2678 & setparaccess = .false.)
2679 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2680
2681# ifdef SOLVE3D
2682 vinfo( 1)='Luvel'
2683 vinfo( 2)='adjoint sensitivity on 3D U-momentum'
2684 vinfo( 9)='off'
2685 vinfo(10)='on'
2686 status=def_var(ng, model, ncid, varid, nf90_int, &
2687 & 1, (/0/), aval, vinfo, ncname, &
2688 & setparaccess = .false.)
2689 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2690
2691 vinfo( 1)='Lvvel'
2692 vinfo( 2)='adjoint sensitivity on 3D V-momentum'
2693 vinfo( 9)='off'
2694 vinfo(10)='on'
2695 status=def_var(ng, model, ncid, varid, nf90_int, &
2696 & 1, (/0/), aval, vinfo, ncname, &
2697 & setparaccess = .false.)
2698 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2699
2700 vinfo( 1)='Ltracer'
2701 vinfo( 2)='adjoint sensitivity on tracer variables'
2702 vinfo( 9)='off'
2703 vinfo(10)='on'
2704 status=def_var(ng, model, ncid, varid, nf90_int, &
2705 & 1, (/trcdim/), aval, vinfo, ncname, &
2706 & setparaccess = .false.)
2707 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2708
2709 vinfo( 1)='KstrS'
2710 vinfo( 2)='deepest level for adjoint sensitivity analysis'
2711 status=def_var(ng, model, ncid, varid, nf90_int, &
2712 & 1, (/0/), aval, vinfo, ncname, &
2713 & setparaccess = .false.)
2714 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2715
2716 vinfo( 1)='KendS'
2717 vinfo( 2)='shallowest level for adjoint sensitivity analysis'
2718 status=def_var(ng, model, ncid, varid, nf90_int, &
2719 & 1, (/0/), aval, vinfo, ncname, &
2720 & setparaccess = .false.)
2721 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2722# endif
2723#endif
2724
2725#if defined FORCING_SV || defined SO_SEMI || defined STOCHASTIC_OPT
2726
2727
2728
2729 vinfo( 1)='Fzeta'
2730# ifdef FORCING_SV
2731 vinfo( 2)='forcing singular vectors for free-surface'
2732# else
2733 vinfo( 2)='stochastic optimals for free-surface'
2734# endif
2735 vinfo( 9)='off'
2736 vinfo(10)='on'
2737 status=def_var(ng, model, ncid, varid, nf90_int, &
2738 & 1, (/0/), aval, vinfo, ncname, &
2739 & setparaccess = .false.)
2740 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2741
2742# ifndef SOLVE3D
2743 vinfo( 1)='Fubar'
2744# ifdef FORCING_SV
2745 vinfo( 2)='forcing singular vectors for 2D U-momentum'
2746# else
2747 vinfo( 2)='stochastic optimals for 2D U-momentum'
2748# endif
2749 vinfo( 9)='off'
2750 vinfo(10)='on'
2751 status=def_var(ng, model, ncid, varid, nf90_int, &
2752 & 1, (/0/), aval, vinfo, ncname, &
2753 & setparaccess = .false.)
2754 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2755
2756 vinfo( 1)='Fvbar'
2757# ifdef FORCING_SV
2758 vinfo( 2)='forcing singular vectors for 2D V-momentum'
2759# else
2760 vinfo( 2)='stochastic optimals for 2D V-momentum'
2761# endif
2762 vinfo( 9)='off'
2763 vinfo(10)='on'
2764 status=def_var(ng, model, ncid, varid, nf90_int, &
2765 & 1, (/0/), aval, vinfo, ncname, &
2766 & setparaccess = .false.)
2767 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2768
2769# else
2770
2771 vinfo( 1)='Fuvel'
2772# ifdef FORCING_SV
2773 vinfo( 2)='forcing singular vectors for 3D U-momentum'
2774# else
2775 vinfo( 2)='stochastic optimals for 3D U-momentum'
2776# endif
2777 vinfo( 9)='off'
2778 vinfo(10)='on'
2779 status=def_var(ng, model, ncid, varid, nf90_int, &
2780 & 1, (/0/), aval, vinfo, ncname, &
2781 & setparaccess = .false.)
2782 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2783
2784 vinfo( 1)='Fvvel'
2785# ifdef FORCING_SV
2786 vinfo( 2)='forcing singular vectors for 3D V-momentum'
2787# else
2788 vinfo( 2)='stochastic optimals for 3D V-momentum'
2789# endif
2790 vinfo( 9)='off'
2791 vinfo(10)='on'
2792 status=def_var(ng, model, ncid, varid, nf90_int, &
2793 & 1, (/0/), aval, vinfo, ncname, &
2794 & setparaccess = .false.)
2795 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2796
2797 vinfo( 1)='Ftracer'
2798# ifdef FORCING_SV
2799 vinfo( 2)='forcing singular vectors for tracer variables'
2800# else
2801 vinfo( 2)='stochastic optimals for tracer variables'
2802# endif
2803 vinfo( 9)='off'
2804 vinfo(10)='on'
2805 status=def_var(ng, model, ncid, varid, nf90_int, &
2806 & 1, (/trcdim/), aval, vinfo, ncname, &
2807 & setparaccess = .false.)
2808 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2809# endif
2810
2811 vinfo( 1)='Fsustr'
2812# ifdef FORCING_SV
2813 vinfo( 2)='forcing singular vectors for surface U-stress'
2814# else
2815 vinfo( 2)='stochastic optimals for surface U-stress'
2816# endif
2817 vinfo( 9)='off'
2818 vinfo(10)='on'
2819 status=def_var(ng, model, ncid, varid, nf90_int, &
2820 & 1, (/0/), aval, vinfo, ncname, &
2821 & setparaccess = .false.)
2822 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2823
2824 vinfo( 1)='Fsvstr'
2825# ifdef FORCING_SV
2826 vinfo( 2)='forcing singular vectors for surface V-stress'
2827# else
2828 vinfo( 2)='stochastic optimals for surface V-stress'
2829# endif
2830 vinfo( 9)='off'
2831 vinfo(10)='on'
2832 status=def_var(ng, model, ncid, varid, nf90_int, &
2833 & 1, (/0/), aval, vinfo, ncname, &
2834 & setparaccess = .false.)
2835 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2836
2837# ifdef SOLVE3D
2838 vinfo( 1)='Fstflx'
2839# ifdef FORCING_SV
2840 vinfo( 2)='forcing singular vectors for surface tracer flux'
2841# else
2842 vinfo( 2)='stochastic optimals for surface tracer flux'
2843# endif
2844 vinfo( 9)='off'
2845 vinfo(10)='on'
2846 status=def_var(ng, model, ncid, varid, nf90_int, &
2847 & 1, (/trcdim/), aval, vinfo, ncname, &
2848 & setparaccess = .false.)
2849 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2850# endif
2851#endif
2852
2853#ifdef SO_SEMI
2854
2855
2856
2857# ifndef SO_SEMI_WHITE
2858 vinfo( 1)='SO_decay'
2859 vinfo( 2)='red noise stochastic optimals time decorrelation'
2860 vinfo( 3)='day'
2861 status=def_var(ng, model, ncid, varid,
nf_type, &
2862 & 1, (/0/), aval, vinfo, ncname, &
2863 & setparaccess = .false.)
2864 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2865# endif
2866
2867 vinfo( 1)='SO_trace'
2868 vinfo( 2)='trace of stochastic optimals matrix'
2869 status=def_var(ng, model, ncid, varid,
nf_type, &
2870 & 1, (/0/), aval, vinfo, ncname, &
2871 & setparaccess = .false.)
2872 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2873
2874 vinfo( 1)='SOsdev_zeta'
2875 vinfo( 2)='stochastic optimals scale, free-surface'
2876 status=def_var(ng, model, ncid, varid,
nf_type, &
2877 & 1, (/0/), aval, vinfo, ncname, &
2878 & setparaccess = .false.)
2879 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2880
2881# ifndef SOLVE3D
2882 vinfo( 1)='SOsdev_ubar'
2883 vinfo( 2)='stochastic optimals scale, 2D U-momentum'
2884 status=def_var(ng, model, ncid, varid,
nf_type, &
2885 & 1, (/0/), aval, vinfo, ncname, &
2886 & setparaccess = .false.)
2887 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2888
2889 vinfo( 1)='SOsdev_vbar'
2890 vinfo( 2)='stochastic optimals scale, 2D V-momentum'
2891 status=def_var(ng, model, ncid, varid,
nf_type, &
2892 & 1, (/0/), aval, vinfo, ncname, &
2893 & setparaccess = .false.)
2894 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2895
2896# else
2897
2898 vinfo( 1)='SOsdev_uvel'
2899 vinfo( 2)='stochastic optimals scale, 3D U-momentum'
2900 status=def_var(ng, model, ncid, varid,
nf_type, &
2901 & 1, (/0/), aval, vinfo, ncname, &
2902 & setparaccess = .false.)
2903 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2904
2905 vinfo( 1)='SOsdev_vvel'
2906 vinfo( 2)='stochastic optimals scale, 3D V-momentum'
2907 status=def_var(ng, model, ncid, varid,
nf_type, &
2908 & 1, (/0/), aval, vinfo, ncname, &
2909 & setparaccess = .false.)
2910 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2911
2912 vinfo( 1)='SOsdev_tracer'
2913 vinfo( 2)='stochastic optimals scale, tracer variables'
2914 status=def_var(ng, model, ncid, varid,
nf_type, &
2915 & 1, (/trcdim/), aval, vinfo, ncname, &
2916 & setparaccess = .false.)
2917 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2918# endif
2919
2920 vinfo( 1)='SOsdev_sustr'
2921 vinfo( 2)='stochastic optimals scale, surface U-stress'
2922 status=def_var(ng, model, ncid, varid,
nf_type, &
2923 & 1, (/0/), aval, vinfo, ncname, &
2924 & setparaccess = .false.)
2925 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2926
2927 vinfo( 1)='SOsdev_svstr'
2928 vinfo( 2)='stochastic optimals scale, surface V-stress'
2929 status=def_var(ng, model, ncid, varid,
nf_type, &
2930 & 1, (/0/), aval, vinfo, ncname, &
2931 & setparaccess = .false.)
2932 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2933
2934# ifdef SOLVE3D
2935 vinfo( 1)='SOsdev_stflx'
2936 vinfo( 2)='stochastic optimals scale, surface tracer flux'
2937 status=def_var(ng, model, ncid, varid,
nf_type, &
2938 & 1, (/trcdim/), aval, vinfo, ncname, &
2939 & setparaccess = .false.)
2940 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2941# endif
2942#endif
2943
2944#if defined BIOLOGY && defined SOLVE3D
2945# if defined BIO_FENNEL
2946# include <fennel_def.h>
2947# elif defined ECOSIM
2948# include <ecosim_def.h>
2949# elif defined HYPOXIA_SRM
2950# include <hypoxia_srm_def.h>
2951# elif defined NEMURO
2952# include <nemuro_def.h>
2953# elif defined NPZD_FRANKS
2954# include <npzd_Franks_def.h>
2955# elif defined NPZD_IRON
2956# include <npzd_iron_def.h>
2957# elif defined NPZD_POWELL
2958# include <npzd_Powell_def.h>
2959# elif defined RED_TIDE
2960# include <red_tide_def.h>
2961# endif
2962#endif
2963
2964#if defined FLOATS && defined FLOAT_BIOLOGY
2965# if defined FLOAT_OYSTER
2966# include <oyster_floats_def.h>
2967# endif
2968#endif
2969
2970#ifdef SEDIMENT
2971# include <sediment_def.h>
2972#endif
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982 vinfo( 1)='spherical'
2983 vinfo( 2)='grid type logical switch'
2984 vinfo( 9)='Cartesian'
2985 vinfo(10)='spherical'
2986 status=def_var(ng, model, ncid, varid, nf90_int, &
2987 & 1, (/0/), aval, vinfo, ncname, &
2988 & setparaccess = .false.)
2989 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
2990
2991
2992
2993 vinfo( 1)='xl'
2994 vinfo( 2)='domain length in the XI-direction'
2995 vinfo( 3)='meter'
2996 status=def_var(ng, model, ncid, varid,
nf_type, &
2997 & 1, (/0/), aval, vinfo, ncname, &
2998 & setparaccess = .false.)
2999 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3000
3001 vinfo( 1)='el'
3002 vinfo( 2)='domain length in the ETA-direction'
3003 vinfo( 3)='meter'
3004 status=def_var(ng, model, ncid, varid,
nf_type, &
3005 & 1, (/0/), aval, vinfo, ncname, &
3006 & setparaccess = .false.)
3007 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3008#ifdef SOLVE3D
3009
3010
3011
3012 vinfo( 1)='Vtransform'
3013 vinfo( 2)='vertical terrain-following transformation equation'
3014 status=def_var(ng, model, ncid, varid, nf90_int, &
3015 & 1, (/0/), aval, vinfo, ncname, &
3016 & setparaccess = .false.)
3017 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3018
3019 vinfo( 1)='Vstretching'
3020 vinfo( 2)='vertical terrain-following stretching function'
3021 status=def_var(ng, model, ncid, varid, nf90_int, &
3022 & 1, (/0/), aval, vinfo, ncname, &
3023 & setparaccess = .false.)
3024 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3025
3026 vinfo( 1)='theta_s'
3027 vinfo( 2)='S-coordinate surface control parameter'
3028 status=def_var(ng, model, ncid, varid,
nf_tout, &
3029 & 1, (/0/), aval, vinfo, ncname, &
3030 & setparaccess = .false.)
3031 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3032
3033 vinfo( 1)='theta_b'
3034 vinfo( 2)='S-coordinate bottom control parameter'
3035 status=def_var(ng, model, ncid, varid,
nf_tout, &
3036 & 1, (/0/), aval, vinfo, ncname, &
3037 & setparaccess = .false.)
3038 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3039
3040 vinfo( 1)='Tcline'
3041 vinfo( 2)='S-coordinate surface/bottom layer width'
3042 vinfo( 3)='meter'
3043 status=def_var(ng, model, ncid, varid,
nf_tout, &
3044 & 1, (/0/), aval, vinfo, ncname, &
3045 & setparaccess = .false.)
3046 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3047
3048 vinfo( 1)='hc'
3049 vinfo( 2)='S-coordinate parameter, critical depth'
3050 vinfo( 3)='meter'
3051 status=def_var(ng, model, ncid, varid,
nf_tout, &
3052 & 1, (/0/), aval, vinfo, ncname, &
3053 & setparaccess = .false.)
3054 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3055
3056
3057
3058 vinfo( 1)='grid'
3059 status=def_var(ng, model, ncid, varid, nf90_int, &
3060 & 1, (/0/), aval, vinfo, ncname, &
3061 & setparaccess = .false.)
3062 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3063
3064
3065
3066 vinfo( 1)='s_rho'
3067 vinfo( 2)='S-coordinate at RHO-points'
3068 vinfo( 5)='valid_min'
3069 vinfo( 6)='valid_max'
3070 IF (vtransform(ng).eq.1) THEN
3071 vinfo(21)='ocean_s_coordinate_g1'
3072 ELSE IF (vtransform(ng).eq.2) THEN
3073 vinfo(21)='ocean_s_coordinate_g2'
3074 END IF
3075# if defined SEDIMENT && defined SED_MORPH
3076 vinfo(23)='s: s_rho C: Cs_r eta: zeta depth: bath depth_c: hc'
3077# else
3078 vinfo(23)='s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc'
3079# endif
3080 vinfo(25)='up'
3081 aval(2)=-1.0_r8
3082 aval(3)=0.0_r8
3083 status=def_var(ng, model, ncid, varid,
nf_tout, &
3084 & 1, (/srdim/), aval, vinfo, ncname, &
3085 & setparaccess = .false.)
3086 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3087
3088
3089
3090 vinfo( 1)='s_w'
3091 vinfo( 2)='S-coordinate at W-points'
3092 vinfo( 5)='valid_min'
3093 vinfo( 6)='valid_max'
3094 vinfo(21)='ocean_s_coordinate'
3095 IF (vtransform(ng).eq.1) THEN
3096 vinfo(21)='ocean_s_coordinate_g1'
3097 ELSE IF (vtransform(ng).eq.2) THEN
3098 vinfo(21)='ocean_s_coordinate_g2'
3099 END IF
3100# if defined SEDIMENT && defined SED_MORPH
3101 vinfo(23)='s: s_w C: Cs_w eta: zeta depth: bath depth_c: hc'
3102# else
3103 vinfo(23)='s: s_w C: Cs_w eta: zeta depth: h depth_c: hc'
3104# endif
3105 vinfo(25)='up'
3106 aval(2)=-1.0_r8
3107 aval(3)=0.0_r8
3108 status=def_var(ng, model, ncid, varid,
nf_tout, &
3109 & 1, (/swdim/), aval, vinfo, ncname, &
3110 & setparaccess = .false.)
3111 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3112
3113
3114
3115 vinfo( 1)='Cs_r'
3116 vinfo( 2)='S-coordinate stretching curves at RHO-points'
3117 vinfo( 5)='valid_min'
3118 vinfo( 6)='valid_max'
3119 aval(2)=-1.0_r8
3120 aval(3)=0.0_r8
3121 status=def_var(ng, model, ncid, varid,
nf_tout, &
3122 & 1, (/srdim/), aval, vinfo, ncname, &
3123 & setparaccess = .false.)
3124 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3125
3126
3127
3128 vinfo( 1)='Cs_w'
3129 vinfo( 2)='S-coordinate stretching curves at W-points'
3130 vinfo( 5)='valid_min'
3131 vinfo( 6)='valid_max'
3132 aval(2)=-1.0_r8
3133 aval(3)=0.0_r8
3134 status=def_var(ng, model, ncid, varid,
nf_tout, &
3135 & 1, (/swdim/), aval, vinfo, ncname, &
3136 & setparaccess = .false.)
3137 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3138#endif
3139
3140
3141
3142 IF (nuser.gt.0) THEN
3143 vinfo( 1)='user'
3144 vinfo( 2)='user generic parameters'
3145 vinfo(24)='_FillValue'
3146 aval(6)=spval
3147 status=def_var(ng, model, ncid, varid,
nf_type, &
3148 & 1, (/usrdim/), aval, vinfo, ncname, &
3149 & setparaccess = .false.)
3150 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3151 END IF
3152#ifdef STATIONS
3153
3154
3155
3156 IF (ncid.eq.sta(ng)%ncid) THEN
3157 vinfo( 1)='Ipos'
3158 vinfo( 2)='stations I-direction positions'
3159 status=def_var(ng, model, ncid, varid,
nf_type, &
3160 & 1, (/stadim/), aval, vinfo, ncname, &
3161 & setparaccess = .false.)
3162 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3163
3164 vinfo( 1)='Jpos'
3165 vinfo( 2)='stations J-direction positions'
3166 status=def_var(ng, model, ncid, varid,
nf_type, &
3167 & 1, (/stadim/), aval, vinfo, ncname, &
3168 & setparaccess = .false.)
3169 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3170 END IF
3171#endif
3172#ifdef NO_WRITE_GRID
3173 IF (ncid.eq.sta(ng)%ncid) THEN
3174#else
3175 IF (ncid.ne.flt(ng)%ncid) THEN
3176#endif
3177#if !(defined SED_MORPH && defined SEDIMENT)
3178
3179
3180
3181 vinfo( 1)=vname(1,idtopo)
3182 vinfo( 2)=vname(2,idtopo)
3183 vinfo( 3)=vname(3,idtopo)
3184 vinfo(14)=vname(4,idtopo)
3185 vinfo(21)=vname(6,idtopo)
3186 vinfo(22)='coordinates'
3187 aval(5)=real(iinfo(1,idtopo,ng),r8)
3188 IF (ncid.eq.sta(ng)%ncid) THEN
3189 status=def_var(ng, model, ncid, varid,
nf_type, &
3190 & 1, (/stadim/), aval, vinfo, ncname)
3191 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3192 ELSE
3193 status=def_var(ng, model, ncid, varid,
nf_type, &
3194 & 2, t2dgrd, aval, vinfo, ncname)
3195 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3196 END IF
3197#endif
3198
3199
3200
3201 IF (ncid.ne.sta(ng)%ncid) THEN
3202 vinfo( 1)=vname(1,idfcor)
3203 vinfo( 2)=vname(2,idfcor)
3204 vinfo( 3)=vname(3,idfcor)
3205 vinfo(14)=vname(4,idfcor)
3206 vinfo(21)=vname(6,idfcor)
3207 vinfo(22)='coordinates'
3208 aval(5)=real(iinfo(1,idfcor,ng),r8)
3209 status=def_var(ng, model, ncid, varid,
nf_type, &
3210 & 2, t2dgrd, aval, vinfo, ncname)
3211 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3212 END IF
3213
3214
3215
3216 IF (ncid.ne.sta(ng)%ncid) THEN
3217 vinfo( 1)=vname(1,idpmdx)
3218 vinfo( 2)=vname(2,idpmdx)
3219 vinfo( 3)=vname(3,idpmdx)
3220 vinfo(14)=vname(4,idpmdx)
3221 vinfo(21)=vname(6,idpmdx)
3222 vinfo(22)='coordinates'
3223 aval(5)=real(iinfo(1,idpmdx,ng),r8)
3224 status=def_var(ng, model, ncid, varid,
nf_type, &
3225 & 2, t2dgrd, aval, vinfo, ncname)
3226 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3227
3228 vinfo( 1)=vname(1,idpndy)
3229 vinfo( 2)=vname(2,idpndy)
3230 vinfo( 3)=vname(3,idpndy)
3231 vinfo(14)=vname(4,idpndy)
3232 vinfo(21)=vname(6,idpndy)
3233 vinfo(22)='coordinates'
3234 aval(5)=real(iinfo(1,idpndy,ng),r8)
3235 status=def_var(ng, model, ncid, varid,
nf_type, &
3236 & 2, t2dgrd, aval, vinfo, ncname)
3237 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3238 END IF
3239
3240
3241
3242 IF (spherical) THEN
3243 vinfo( 1)=vname(1,idlonr)
3244 vinfo( 2)=vname(2,idlonr)
3245 vinfo( 3)=vname(3,idlonr)
3246 vinfo(14)=vname(4,idlonr)
3247 vinfo(21)=vname(6,idlonr)
3248 IF (ncid.eq.sta(ng)%ncid) THEN
3249 status=def_var(ng, model, ncid, varid,
nf_type, &
3250 & 1, (/stadim/), aval, vinfo, ncname)
3251 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3252 ELSE
3253 status=def_var(ng, model, ncid, varid,
nf_type, &
3254 & 2, t2dgrd, aval, vinfo, ncname)
3255 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3256 END IF
3257
3258 vinfo( 1)=vname(1,idlatr)
3259 vinfo( 2)=vname(2,idlatr)
3260 vinfo( 3)=vname(3,idlatr)
3261 vinfo(14)=vname(4,idlatr)
3262 vinfo(21)=vname(6,idlatr)
3263 IF (ncid.eq.sta(ng)%ncid) THEN
3264 status=def_var(ng, model, ncid, varid,
nf_type, &
3265 & 1, (/stadim/), aval, vinfo, ncname)
3266 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3267 ELSE
3268 status=def_var(ng, model, ncid, varid,
nf_type, &
3269 & 2, t2dgrd, aval, vinfo, ncname)
3270 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3271 END IF
3272 ELSE
3273 vinfo( 1)=vname(1,idxgrr)
3274 vinfo( 2)=vname(2,idxgrr)
3275 vinfo( 3)=vname(3,idxgrr)
3276 vinfo(14)=vname(4,idxgrr)
3277 vinfo(21)=vname(6,idxgrr)
3278 IF (ncid.eq.sta(ng)%ncid) THEN
3279 status=def_var(ng, model, ncid, varid,
nf_type, &
3280 & 1, (/stadim/), aval, vinfo, ncname)
3281 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3282 ELSE
3283 status=def_var(ng, model, ncid, varid,
nf_type, &
3284 & 2, t2dgrd, aval, vinfo, ncname)
3285 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3286 END IF
3287
3288 vinfo( 1)=vname(1,idygrr)
3289 vinfo( 2)=vname(2,idygrr)
3290 vinfo( 3)=vname(3,idygrr)
3291 vinfo(14)=vname(4,idygrr)
3292 vinfo(21)=vname(6,idygrr)
3293 IF (ncid.eq.sta(ng)%ncid) THEN
3294 status=def_var(ng, model, ncid, varid,
nf_type, &
3295 & 1, (/stadim/), aval, vinfo, ncname)
3296 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3297 ELSE
3298 status=def_var(ng, model, ncid, varid,
nf_type, &
3299 & 2, t2dgrd, aval, vinfo, ncname)
3300 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3301 END IF
3302 END IF
3303
3304
3305
3306 IF (spherical) THEN
3307 vinfo( 1)=vname(1,idlonu)
3308 vinfo( 2)=vname(2,idlonu)
3309 vinfo( 3)=vname(3,idlonu)
3310 vinfo(14)=vname(4,idlonu)
3311 vinfo(21)=vname(6,idlonu)
3312 IF (ncid.ne.sta(ng)%ncid) THEN
3313 status=def_var(ng, model, ncid, varid,
nf_type, &
3314 & 2, u2dgrd, aval, vinfo, ncname)
3315 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3316 END IF
3317
3318 vinfo( 1)=vname(1,idlatu)
3319 vinfo( 2)=vname(2,idlatu)
3320 vinfo( 3)=vname(3,idlatu)
3321 vinfo(14)=vname(4,idlatu)
3322 vinfo(21)=vname(6,idlatu)
3323 IF (ncid.ne.sta(ng)%ncid) THEN
3324 status=def_var(ng, model, ncid, varid,
nf_type, &
3325 & 2, u2dgrd, aval, vinfo, ncname)
3326 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3327 END IF
3328 ELSE
3329 vinfo( 1)=vname(1,idxgru)
3330 vinfo( 2)=vname(2,idxgru)
3331 vinfo( 3)=vname(3,idxgru)
3332 vinfo(14)=vname(4,idxgru)
3333 vinfo(21)=vname(6,idxgru)
3334 IF (ncid.ne.sta(ng)%ncid) THEN
3335 status=def_var(ng, model, ncid, varid,
nf_type, &
3336 & 2, u2dgrd, aval, vinfo, ncname)
3337 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3338 END IF
3339
3340 vinfo( 1)=vname(1,idygru)
3341 vinfo( 2)=vname(2,idygru)
3342 vinfo( 3)=vname(3,idygru)
3343 vinfo(14)=vname(4,idygru)
3344 vinfo(21)=vname(6,idygru)
3345 IF (ncid.ne.sta(ng)%ncid) THEN
3346 status=def_var(ng, model, ncid, varid,
nf_type, &
3347 & 2, u2dgrd, aval, vinfo, ncname)
3348 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3349 END IF
3350 END IF
3351
3352
3353
3354 IF (spherical) THEN
3355 vinfo( 1)=vname(1,idlonv)
3356 vinfo( 2)=vname(2,idlonv)
3357 vinfo( 3)=vname(3,idlonv)
3358 vinfo(14)=vname(4,idlonv)
3359 vinfo(21)=vname(6,idlonv)
3360 IF (ncid.ne.sta(ng)%ncid) THEN
3361 status=def_var(ng, model, ncid, varid,
nf_type, &
3362 & 2, v2dgrd, aval, vinfo, ncname)
3363 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3364 END IF
3365
3366 vinfo( 1)=vname(1,idlatv)
3367 vinfo( 2)=vname(2,idlatv)
3368 vinfo( 3)=vname(3,idlatv)
3369 vinfo(14)=vname(4,idlatv)
3370 vinfo(21)=vname(6,idlatv)
3371 IF (ncid.ne.sta(ng)%ncid) THEN
3372 status=def_var(ng, model, ncid, varid,
nf_type, &
3373 & 2, v2dgrd, aval, vinfo, ncname)
3374 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3375 END IF
3376 ELSE
3377 vinfo( 1)=vname(1,idxgrv)
3378 vinfo( 2)=vname(2,idxgrv)
3379 vinfo( 3)=vname(3,idxgrv)
3380 vinfo(14)=vname(4,idxgrv)
3381 vinfo(21)=vname(6,idxgrv)
3382 IF (ncid.ne.sta(ng)%ncid) THEN
3383 status=def_var(ng, model, ncid, varid,
nf_type, &
3384 & 2, v2dgrd, aval, vinfo, ncname)
3385 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3386 END IF
3387
3388 vinfo( 1)=vname(1,idygrv)
3389 vinfo( 2)=vname(2,idygrv)
3390 vinfo( 3)=vname(3,idygrv)
3391 vinfo(14)=vname(4,idygrv)
3392 vinfo(21)=vname(6,idygrv)
3393 IF (ncid.ne.sta(ng)%ncid) THEN
3394 status=def_var(ng, model, ncid, varid,
nf_type, &
3395 & 2, v2dgrd, aval, vinfo, ncname)
3396 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3397 END IF
3398 END IF
3399
3400
3401
3402 IF (spherical) THEN
3403 vinfo( 1)=vname(1,idlonp)
3404 vinfo( 2)=vname(2,idlonp)
3405 vinfo( 3)=vname(3,idlonp)
3406 vinfo(14)=vname(4,idlonp)
3407 vinfo(21)=vname(6,idlonp)
3408 IF (ncid.ne.sta(ng)%ncid) THEN
3409 status=def_var(ng, model, ncid, varid,
nf_type, &
3410 & 2, p2dgrd, aval, vinfo, ncname)
3411 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3412 END IF
3413
3414 vinfo( 1)=vname(1,idlatp)
3415 vinfo( 2)=vname(2,idlatp)
3416 vinfo( 3)=vname(3,idlatp)
3417 vinfo(14)=vname(4,idlatp)
3418 vinfo(21)=vname(6,idlatp)
3419 IF (ncid.ne.sta(ng)%ncid) THEN
3420 status=def_var(ng, model, ncid, varid,
nf_type, &
3421 & 2, p2dgrd, aval, vinfo, ncname)
3422 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3423 END IF
3424 ELSE
3425 vinfo( 1)=vname(1,idxgrp)
3426 vinfo( 2)=vname(2,idxgrp)
3427 vinfo( 3)=vname(3,idxgrp)
3428 vinfo(14)=vname(4,idxgrp)
3429 vinfo(21)=vname(6,idxgrp)
3430 IF (ncid.ne.sta(ng)%ncid) THEN
3431 status=def_var(ng, model, ncid, varid,
nf_type, &
3432 & 2, p2dgrd, aval, vinfo, ncname)
3433 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3434 END IF
3435
3436 vinfo( 1)=vname(1,idygrp)
3437 vinfo( 2)=vname(2,idygrp)
3438 vinfo( 3)=vname(3,idygrp)
3439 vinfo(14)=vname(4,idygrp)
3440 vinfo(21)=vname(6,idygrp)
3441 IF (ncid.ne.sta(ng)%ncid) THEN
3442 status=def_var(ng, model, ncid, varid,
nf_type, &
3443 & 2, p2dgrd, aval, vinfo, ncname)
3444 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3445 END IF
3446 END IF
3447
3448#ifdef CURVGRID
3449
3450
3451
3452 vinfo( 1)=vname(1,idangr)
3453 vinfo( 2)=vname(2,idangr)
3454 vinfo( 3)=vname(3,idangr)
3455 vinfo(14)=vname(4,idangr)
3456 vinfo(21)=vname(6,idangr)
3457 vinfo(22)='coordinates'
3458 aval(5)=real(iinfo(1,idangr,ng),r8)
3459 IF (ncid.eq.sta(ng)%ncid) THEN
3460 status=def_var(ng, model, ncid, varid,
nf_type, &
3461 & 1, (/stadim/), aval, vinfo, ncname)
3462 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3463 ELSE
3464 status=def_var(ng, model, ncid, varid,
nf_type, &
3465 & 2, t2dgrd, aval, vinfo, ncname)
3466 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3467 END IF
3468#endif
3469#ifdef MASKING
3470
3471
3472
3473 IF (ncid.ne.sta(ng)%ncid) THEN
3474 vinfo( 1)=vname(1,idmskr)
3475 vinfo( 2)=vname(2,idmskr)
3476 vinfo( 9)='land'
3477 vinfo(10)='water'
3478 vinfo(21)=vname(6,idmskr)
3479 vinfo(22)='coordinates'
3480 aval(5)=real(iinfo(1,idmskr,ng),r8)
3481 status=def_var(ng, model, ncid, varid,
nf_type, &
3482 & 2, t2dgrd, aval, vinfo, ncname)
3483 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3484
3485 vinfo( 1)=vname(1,idmsku)
3486 vinfo( 2)=vname(2,idmsku)
3487 vinfo( 9)='land'
3488 vinfo(10)='water'
3489 vinfo(21)=vname(6,idmsku)
3490 vinfo(22)='coordinates'
3491 aval(5)=real(iinfo(1,idmsku,ng),r8)
3492 status=def_var(ng, model, ncid, varid,
nf_type, &
3493 & 2, u2dgrd, aval, vinfo, ncname)
3494 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3495
3496 vinfo( 1)=vname(1,idmskv)
3497 vinfo( 2)=vname(2,idmskv)
3498 vinfo( 9)='land'
3499 vinfo(10)='water'
3500 vinfo(21)=vname(6,idmskv)
3501 vinfo(22)='coordinates'
3502 aval(5)=real(iinfo(1,idmskv,ng),r8)
3503 status=def_var(ng, model, ncid, varid,
nf_type, &
3504 & 2, v2dgrd, aval, vinfo, ncname)
3505 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3506
3507 vinfo( 1)=vname(1,idmskp)
3508 vinfo( 2)=vname(2,idmskp)
3509 vinfo( 9)='land'
3510 vinfo(10)='water'
3511 vinfo(21)=vname(6,idmskp)
3512 vinfo(22)='coordinates'
3513 aval(5)=real(iinfo(1,idmskp,ng),r8)
3514 status=def_var(ng, model, ncid, varid,
nf_type, &
3515 & 2, p2dgrd, aval, vinfo, ncname)
3516 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3517 END IF
3518#endif
3519#if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
3520 defined opt_observations || defined sensitivity_4dvar || \
3521 defined so_semi
3522
3523
3524
3525 IF (ncid.ne.sta(ng)%ncid) THEN
3526 vinfo( 1)=vname(1,idscor)
3527 vinfo( 2)=vname(2,idscor)
3528 vinfo( 9)='inactive'
3529 vinfo(10)='active'
3530 vinfo(21)=vname(6,idscor)
3531 vinfo(22)='coordinates'
3532 aval(5)=real(iinfo(1,idscor,ng),r8)
3533 status=def_var(ng, model, ncid, varid,
nf_type, &
3534 & 2, t2dgrd, aval, vinfo, ncname)
3535 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3536
3537 vinfo( 1)=vname(1,idscou)
3538 vinfo( 2)=vname(2,idscou)
3539 vinfo( 9)='inactive'
3540 vinfo(10)='active'
3541 vinfo(21)=vname(6,idscou)
3542 vinfo(22)='coordinates'
3543 aval(5)=real(iinfo(1,idscou,ng),r8)
3544 status=def_var(ng, model, ncid, varid,
nf_type, &
3545 & 2, u2dgrd, aval, vinfo, ncname)
3546 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3547
3548 vinfo( 1)=vname(1,idscov)
3549 vinfo( 2)=vname(2,idscov)
3550 vinfo( 9)='inactive'
3551 vinfo(10)='active'
3552 vinfo(21)=vname(6,idscov)
3553 vinfo(22)='coordinates'
3554 aval(5)=real(iinfo(1,idscov,ng),r8)
3555 status=def_var(ng, model, ncid, varid,
nf_type, &
3556 & 2, v2dgrd, aval, vinfo, ncname)
3557 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3558 END IF
3559#endif
3560#ifdef UV_DRAG_GRID
3561
3562
3563
3564 IF (ncid.ne.sta(ng)%ncid) THEN
3565# if defined UV_LOGDRAG || defined BBL_MODEL
3566 vinfo( 1)=vname(1,idzobl)
3567 vinfo( 2)=vname(2,idzobl)
3568 vinfo( 3)=vname(3,idzobl)
3569 vinfo(14)=vname(4,idzobl)
3570 vinfo(21)=vname(6,idzobl)
3571 vinfo(22)='coordinates'
3572 aval(5)=real(iinfo(1,idzobl,ng),r8)
3573 status=def_var(ng, model, ncid, varid,
nf_type, &
3574 & 2, t2dgrd, aval, vinfo, ncname)
3575 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3576# endif
3577# ifdef UV_LDRAG
3578 vinfo( 1)=vname(1,idragl)
3579 vinfo( 2)=vname(2,idragl)
3580 vinfo( 3)=vname(3,idragl)
3581 vinfo(14)=vname(4,idragl)
3582 vinfo(21)=vname(6,idragl)
3583 vinfo(22)='coordinates'
3584 aval(5)=real(iinfo(1,idragl,ng),r8)
3585 status=def_var(ng, model, ncid, varid,
nf_type, &
3586 & 2, t2dgrd, aval, vinfo, ncname)
3587 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3588# endif
3589# ifdef UV_QDRAG
3590 vinfo( 1)=vname(1,idragq)
3591 vinfo( 2)=vname(2,idragq)
3592 vinfo( 3)=vname(3,idragq)
3593 vinfo(14)=vname(4,idragq)
3594 vinfo(21)=vname(6,idragq)
3595 vinfo(22)='coordinates'
3596 aval(5)=real(iinfo(1,idragq,ng),r8)
3597 status=def_var(ng, model, ncid, varid,
nf_type, &
3598 & 2, t2dgrd, aval, vinfo, ncname)
3599 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
3600# endif
3601 END IF
3602#endif
3603 END IF
3604
3605 10 FORMAT (i0,'x',i0)
3606 20 FORMAT (/,' DEF_INFO_NF90 - error while creating global', &
3607 & ' attribute: ',a,/,17x,a)
3608 30 FORMAT (a,i2.2)
3609
3610 RETURN
integer, parameter nf_tout
integer, parameter nf_type