41 module tracer_manager_mod
52 use fms_mod,
only : lowercase, &
74 use platform_mod,
only : r4_kind, &
95 adjust_positive_def, &
130 module procedure set_tracer_profile_r4
131 module procedure set_tracer_profile_r8
137 character(len=32) :: tracer_name, tracer_units
138 character(len=128) :: tracer_longname
139 integer :: num_methods, model, instances
140 logical :: is_prognostic, instances_set
141 logical :: needs_init
144 logical :: needs_mass_adjust
145 logical :: needs_positive_adjust
151 character(len=32) :: model_name, tracer_name, tracer_units
152 character(len=128) :: tracer_longname
158 character(len=128) :: name
165 integer :: num_tracer_fields = 0
166 integer,
parameter :: MAX_TRACER_FIELDS = 250
167 integer,
parameter :: MAX_TRACER_METHOD = 20
168 integer,
parameter :: NO_TRACER = 1-huge(1)
169 integer,
parameter :: NOTRACER = -huge(1)
171 type(tracer_type),
save :: tracers(MAX_TRACER_FIELDS)
172 type(inst_type) ,
save :: instantiations(MAX_TRACER_FIELDS)
174 integer :: total_tracers(NUM_MODELS), prog_tracers(NUM_MODELS), diag_tracers(NUM_MODELS)
175 logical :: model_registered(NUM_MODELS) = .false.
178 #include<file_version.h>
180 logical :: module_is_initialized = .false.
182 logical :: verbose_local
183 integer :: TRACER_ARRAY(NUM_MODELS,MAX_TRACER_FIELDS)
193 integer :: model, num_tracers, num_prog, num_diag
195 if(module_is_initialized)
return
196 module_is_initialized = .true.
200 tracer_array = notracer
201 do model=1,num_models
211 integer,
intent(in) :: model
212 integer,
intent(out) :: num_tracers, num_prog, num_diag
213 character(len=256) :: warnmesg
215 character(len=32) :: name_type,
type, name
216 integer :: n, m, mod, num_tracer_methods, nfields, swop
217 integer :: j, log_unit, num_methods
219 type(
method_type),
dimension(MAX_TRACER_METHOD) :: methods
220 integer :: instances, siz_inst,i
221 character(len = 32) :: digit,suffnam
223 character(len=128) :: list_name , control
224 integer :: index_list_name
225 logical :: fm_success
238 if ( model_registered(model) )
then
241 num_tracers = total_tracers(model)
242 num_prog = prog_tracers(model)
243 num_diag = diag_tracers(model)
248 num_tracers = 0; num_prog = 0; num_diag = 0
256 if (nfields == 0 )
then
257 if (
mpp_pe() == mpp_root_pe()) &
258 call mpp_error(note,
'tracer_manager_init : No tracers are available to be registered.')
263 total_tracers(model) = 0
268 if (mod == model .and.
type ==
'tracer') then
269 num_tracer_fields = num_tracer_fields + 1
270 total_tracers(model) = total_tracers(model) + 1
274 if(num_tracer_fields > max_tracer_fields)
call mpp_error(fatal, &
275 &
'tracer_manager_init: MAX_TRACER_FIELDS exceeded')
276 tracer_array(model,total_tracers(model)) = num_tracer_fields
277 tracers(num_tracer_fields)%model = model
278 tracers(num_tracer_fields)%tracer_name = name
279 tracers(num_tracer_fields)%tracer_units =
'none'
280 tracers(num_tracer_fields)%tracer_longname = tracers(num_tracer_fields)%tracer_name
281 tracers(num_tracer_fields)%instances_set = .false.
285 tracers(num_tracer_fields)%needs_mass_adjust = .true.
286 tracers(num_tracer_fields)%needs_positive_adjust = .true.
287 if (name ==
'cld_amt')
then
288 tracers(num_tracer_fields)%needs_mass_adjust = .false.
290 if (name ==
'cld_amt' .or. name ==
'liq_wat' .or. name ==
'ice_wat')
then
291 tracers(num_tracer_fields)%needs_positive_adjust = .false.
294 num_tracer_methods = 0
295 methods = default_method
298 select case (methods(j)%method_type)
300 tracers(num_tracer_fields)%tracer_units = methods(j)%method_name
302 tracers(num_tracer_fields)%tracer_longname = methods(j)%method_name
305 siz_inst =
parse(methods(j)%method_name,
"",instances)
306 tracers(num_tracer_fields)%instances = instances
307 tracers(num_tracer_fields)%instances_set = .true.
309 if (methods(j)%method_name ==
"false")
then
310 tracers(num_tracer_fields)%needs_mass_adjust = .false.
312 case (
'adjust_positive_def')
313 if (methods(j)%method_name ==
"false")
then
314 tracers(num_tracer_fields)%needs_positive_adjust = .false.
317 num_tracer_methods = num_tracer_methods+1
321 tracers(num_tracer_fields)%num_methods = num_tracer_methods
322 tracers(num_tracer_fields)%needs_init = .false.
323 flag_type =
query_method(
'tracer_type',model,total_tracers(model),name_type)
324 if (flag_type .and. name_type ==
'diagnostic')
then
325 tracers(num_tracer_fields)%is_prognostic = .false.
327 tracers(num_tracer_fields)%is_prognostic = .true.
329 if (tracers(num_tracer_fields)%is_prognostic)
then
330 num_prog = num_prog+1
332 num_diag = num_diag+1
339 do n = 1, num_tracer_fields
342 if ( model == tracers(n)%model .and. tracers(n)%instances_set )
then
344 if ( num_tracer_fields + tracers(n)%instances > max_tracer_fields )
then
345 write(warnmesg,
'("tracer_manager_init: Number of tracers will exceed MAX_TRACER_FIELDS with &
346 &multiple (",I3," instances) setup of tracer ",A)') tracers(n)%instances,tracers(n)%tracer_name
350 do i = 2, tracers(n)%instances
351 num_tracer_fields = num_tracer_fields + 1
352 total_tracers(model) = total_tracers(model) + 1
353 tracer_array(model,total_tracers(model)) = num_tracer_fields
355 tracers(num_tracer_fields) = tracers(n)
356 if (
query_method(
'instances', model,model_tracer_number(model,n),name, control))
then
359 write (suffnam,
'(''suffix'',i1)') i
360 siz_inst =
parse(control, suffnam,digit)
361 if (siz_inst == 0 )
then
362 write (digit,
'(''_'',i1)') i
364 digit =
"_"//trim(digit)
366 elseif (i .lt. 100)
then
367 write (suffnam,
'(''suffix'',i2)') i
368 siz_inst =
parse(control, suffnam,digit)
369 if (siz_inst == 0 )
then
370 write (digit,
'(''_'',i2)') i
372 digit =
"_"//trim(digit)
375 call mpp_error(fatal,
'tracer_manager_init: MULTIPLE_TRACER_SET_UP exceeds 100 for '// &
376 & tracers(n)%tracer_name )
381 list_name =
"/coupler_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
383 list_name =
"/atmos_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
385 list_name =
"/ocean_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
387 list_name =
"/ice_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
389 list_name =
"/land_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
391 list_name =
"/default/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
394 if (
mpp_pe() == mpp_root_pe() )
write (*,*)
"Creating list name = ",trim(list_name)//trim(digit)
396 index_list_name =
fm_copy_list(trim(list_name),digit, create = .true.)
397 tracers(num_tracer_fields)%tracer_name = trim(tracers(num_tracer_fields)%tracer_name)//trim(digit)
400 if (tracers(num_tracer_fields)%is_prognostic)
then
401 num_prog = num_prog+1
403 num_diag = num_diag+1
408 siz_inst =
parse(control,
"suffix1",digit)
409 if (siz_inst > 0 )
then
410 digit =
"_"//trim(digit)
412 fm_success =
fm_modify_name(trim(list_name), trim(tracers(n)%tracer_name)//trim(digit))
413 tracers(n)%tracer_name = trim(tracers(n)%tracer_name)//trim(digit)
421 if ( mod == model .and.
type ==
'instances' ) then
426 call mpp_error(fatal,
'tracer_manager_init: The instances keyword was found for undefined tracer '&
427 //trim(methods(j)%method_type))
429 if ( tracers(m)%instances_set ) &
430 call mpp_error(fatal,
'tracer_manager_init: The instances keyword was found for '&
431 //trim(methods(j)%method_type)//
' but has previously been defined in the tracer entry')
432 siz_inst =
parse(methods(j)%method_name,
"",instances)
433 tracers(m)%instances = instances
434 call mpp_error(note,
'tracer_manager_init: '//trim(instantiations(j)%name)// &
435 ' will have '//trim(methods(j)%method_name)//
' instances')
437 if ( num_tracer_fields + instances > max_tracer_fields )
then
438 write(warnmesg,
'("tracer_manager_init: Number of tracers will exceed MAX_TRACER_FIELDS with &
439 &multiple (",I3," instances) setup of tracer ",A)') tracers(m)%instances,tracers(m)%tracer_name
444 if (instances .eq. 1)
then
445 siz_inst =
parse(methods(j)%method_control,
'suffix1',digit)
446 if (siz_inst == 0 )
then
449 digit =
"_"//trim(digit)
453 num_tracer_fields = num_tracer_fields + 1
454 total_tracers(model) = total_tracers(model) + 1
455 tracer_array(model,total_tracers(model)) = num_tracer_fields
456 tracers(num_tracer_fields) = tracers(m)
459 write (suffnam,
'(''suffix'',i1)') i
460 siz_inst =
parse(methods(j)%method_control, suffnam,digit)
461 if (siz_inst == 0 )
then
462 write (digit,
'(''_'',i1)') i
464 digit =
"_"//trim(digit)
466 elseif (i .lt. 100)
then
467 write (suffnam,
'(''suffix'',i2)') i
468 siz_inst =
parse(methods(j)%method_control, suffnam,digit)
469 if (siz_inst == 0 )
then
470 write (digit,
'(''_'',i2)') i
472 digit =
"_"//trim(digit)
475 call mpp_error(fatal,
'tracer_manager_init: MULTIPLE_TRACER_SET_UP exceeds 100 for '&
476 //tracers(num_tracer_fields)%tracer_name )
481 list_name =
"/coupler_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
483 list_name =
"/atmos_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
485 list_name =
"/ocean_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
487 list_name =
"/ice_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
489 list_name =
"/land_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
491 list_name =
"/default/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
494 if (
mpp_pe() == mpp_root_pe() )
write (*,*)
"Creating list name = ",trim(list_name)
496 index_list_name =
fm_copy_list(trim(list_name),digit, create = .true.)
498 tracers(num_tracer_fields)%tracer_name = trim(tracers(num_tracer_fields)%tracer_name)//digit
499 if (tracers(num_tracer_fields)%is_prognostic)
then
500 num_prog = num_prog+1
502 num_diag = num_diag+1
506 siz_inst =
parse(methods(j)%method_control,
'suffix1',digit)
507 if (siz_inst == 0 )
then
510 digit =
"_"//trim(digit)
512 fm_success =
fm_modify_name(trim(list_name), trim(tracers(m)%tracer_name)//trim(digit))
513 tracers(m)%tracer_name = trim(tracers(m)%tracer_name)//trim(digit)
518 num_tracers = num_prog + num_diag
520 total_tracers(model) = num_tracers
521 prog_tracers(model) = num_prog
522 diag_tracers(model) = num_diag
523 model_registered(model) = .true.
531 do m = n, num_tracers
533 swop = tracer_array(model,n)
534 tracer_array(model,n) = tracer_array(model,m)
535 tracer_array(model,m) = swop
542 do n=1, num_tracer_fields
547 if (
mpp_pe() == mpp_root_pe() )
then
548 write (log_unit,15) trim(
model_names(model)),total_tracers(model)
551 15
format (
'Number of tracers in field table for ',a,
' model = ',i4)
555 function model_tracer_number(model,n)
556 integer,
intent(in) :: model, n
557 integer model_tracer_number
561 model_tracer_number = no_tracer
563 do i = 1, max_tracer_fields
564 if ( tracer_array(model,i) == n )
then
565 model_tracer_number = i
570 end function model_tracer_number
578 integer,
intent(in) :: model
579 integer,
intent(out) :: num_tracers
580 integer,
intent(out) :: num_prog
581 integer,
intent(out) :: num_diag
582 integer,
intent(out),
optional :: num_family
598 integer,
intent(in) :: model
599 integer,
intent(out),
optional :: num_tracers
601 integer,
intent(out),
optional :: num_prog
603 integer,
intent(out),
optional :: num_diag
605 integer,
intent(out),
optional :: num_family
615 call mpp_error(fatal,
"get_number_tracers : Model number is invalid.")
617 if (
present(num_tracers)) num_tracers = total_tracers(model)
618 if (
present(num_prog)) num_prog = prog_tracers(model)
619 if (
present(num_diag)) num_diag = diag_tracers(model)
620 if (
present(num_family)) num_family = 0
641 integer,
intent(in) :: model
642 integer,
intent(out),
dimension(:),
optional :: ind, prog_ind, diag_ind, fam_ind
644 integer :: i, j, np, nd, n
651 if (
PRESENT(ind)) ind = no_tracer
652 if (
PRESENT(prog_ind)) prog_ind = no_tracer
653 if (
PRESENT(diag_ind)) diag_ind = no_tracer
654 if (
PRESENT(fam_ind)) fam_ind = no_tracer
656 do i = 1, max_tracer_fields
657 j = tracer_array(model,i)
658 if ( j /= notracer)
then
659 if ( model == tracers(j)%model)
then
660 if (
PRESENT(ind))
then
665 if (n >
size(ind(:)))
call mpp_error(fatal, &
666 &
'get_tracer_indices : index array size too small in get_tracer_indices')
670 if (tracers(j)%is_prognostic.and.
PRESENT(prog_ind))
then
675 if ( np >
size( prog_ind(:)))
call mpp_error(fatal,&
676 'get_tracer_indices : prognostic array size too small in get_tracer_indices')
678 else if (.not.tracers(j)%is_prognostic .and.
PRESENT(diag_ind))
then
683 if (nd >
size(diag_ind(:)))
call mpp_error(fatal,&
684 'get_tracer_indices : diagnostic array size too small in get_tracer_indices')
739 integer,
intent(in) :: model
740 character(len=*),
intent(in) :: name
741 integer,
intent(in),
dimension(:),
optional :: indices
743 logical,
intent(in),
optional :: verbose
752 if (
PRESENT(indices))
then
753 do i = 1,
size(indices(:))
754 if (model == tracers(indices(i))%model .and. lowercase(trim(name)) == trim(tracers(indices(i))%tracer_name))
then
760 do i=1, num_tracer_fields
761 if(tracer_array(model,i) == notracer) cycle
762 if (lowercase(trim(name)) == trim(tracers(tracer_array(model,i))%tracer_name))
then
769 verbose_local=.false.
770 if (
present(verbose)) verbose_local=verbose
772 if (verbose_local)
then
775 call mpp_error(note,
'get_tracer_index : tracer with this name not found: '//trim(name))
788 integer,
intent(in) :: model
789 character(len=*),
intent(in) :: name
790 integer,
intent(out) :: index
791 integer,
intent(in),
dimension(:),
optional :: indices
792 logical,
intent(in),
optional :: verbose
796 if(index == no_tracer)
then
812 if (
mpp_pe() == mpp_root_pe() )
then
813 write (log_unit,
'(/,(a))')
'Exiting tracer_manager, have a nice day ...'
816 module_is_initialized = .false.
826 integer,
intent(in) :: model
827 integer,
intent(in) :: n
828 integer :: i, log_unit
832 if(
mpp_pe()==mpp_root_pe() .and. tracer_array(model,n)> 0 )
then
833 i = tracer_array(model,n)
835 write(log_unit, *)
'----------------------------------------------------'
836 write(log_unit, *)
'Contents of tracer entry ', i
837 write(log_unit, *)
'Model type and field name'
838 write(log_unit, *)
'Model : ', tracers(i)%model
839 write(log_unit, *)
'Field name : ', trim(tracers(i)%tracer_name)
840 write(log_unit, *)
'Tracer units : ', trim(tracers(i)%tracer_units)
841 write(log_unit, *)
'Tracer longname : ', trim(tracers(i)%tracer_longname)
842 write(log_unit, *)
'Tracer is_prognostic : ', tracers(i)%is_prognostic
843 write(log_unit, *)
'----------------------------------------------------'
856 integer,
intent(in) :: model
857 integer,
intent(in) :: n
858 character (len=*),
intent(out) :: name
859 character (len=*),
intent(out),
optional :: longname
860 character (len=*),
intent(out),
optional :: units
861 character (len=*),
intent(out),
optional :: err_msg
862 character (len=128) :: err_msg_local
864 character(len=11) :: chn
868 if (n < 1 .or. n > total_tracers(model))
then
869 write(chn,
'(i11)') n
870 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
871 if(error_handler(
'get_tracer_names', err_msg_local, err_msg))
return
873 n1 = tracer_array(model,n)
875 name = trim(tracers(n1)%tracer_name)
876 if (
PRESENT(longname)) longname = trim(tracers(n1)%tracer_longname)
877 if (
PRESENT(units)) units = trim(tracers(n1)%tracer_units)
890 integer,
intent(in) :: model
891 integer,
intent(in) :: n
892 character (len=*),
intent(out) :: name
893 character (len=*),
intent(out),
optional :: longname
894 character (len=*),
intent(out),
optional :: units
895 character (len=*),
intent(out),
optional :: err_msg
905 character (len=128) :: err_msg_local
907 character(len=11) :: chn
911 if (n < 1 .or. n > total_tracers(model))
then
912 write(chn,
'(i11)') n
913 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
914 if(error_handler(
'get_tracer_name', err_msg_local, err_msg))
then
921 n1 = tracer_array(model,n)
923 name = trim(tracers(n1)%tracer_name)
924 if (
PRESENT(longname)) longname = trim(tracers(n1)%tracer_longname)
925 if (
PRESENT(units)) units = trim(tracers(n1)%tracer_units)
941 integer,
intent(in) :: model
942 integer,
intent(in) :: n
944 character(len=*),
intent(out),
optional :: err_msg
945 character(len=128) :: err_msg_local
946 character(len=11) :: chn
950 if (n < 1 .or. n > total_tracers(model))
then
951 write(chn,
'(i11)') n
952 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
954 if(error_handler(
'check_if_prognostic', err_msg_local, err_msg))
return
968 integer,
intent(in) :: model, n
970 character(len=*),
intent(out),
optional :: err_msg
971 character(len=128) :: err_msg_local
972 character(len=11) :: chn
976 if (n < 1 .or. n > total_tracers(model))
then
977 write(chn,
'(i11)') n
978 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
980 if(error_handler(
'adjust_mass', err_msg_local, err_msg))
return
985 adjust_mass = tracers(tracer_array(model,n))%needs_mass_adjust
990 function adjust_positive_def(model, n, err_msg)
992 integer,
intent(in) :: model, n
993 logical :: adjust_positive_def
994 character(len=*),
intent(out),
optional :: err_msg
995 character(len=128) :: err_msg_local
996 character(len=11) :: chn
1000 if (n < 1 .or. n > total_tracers(model))
then
1001 write(chn,
'(i11)') n
1002 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
1003 adjust_positive_def = .true.
1004 if(error_handler(
'adjust_positive_def', err_msg_local, err_msg))
return
1009 adjust_positive_def = tracers(tracer_array(model,n))%needs_positive_adjust
1011 end function adjust_positive_def
1043 integer ,
intent(in) :: model
1044 integer ,
intent(in) :: n
1045 character(len=*),
intent(out) :: name
1048 character(len=*),
intent(out),
optional :: control
1050 character(len=*),
intent(out),
optional :: err_msg
1054 character(len=256) :: list_name
1055 character(len=1024):: control_tr
1056 character(len=16) :: chn,chn1
1057 character(len=128) :: err_msg_local
1063 if (n < 1 .or. n > total_tracers(model))
then
1064 write(chn,
'(i11)') n
1065 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
1066 if(error_handler(
'query_method', err_msg_local, err_msg))
return
1069 n1 = tracer_array(model,n)
1073 list_name =
"/coupler_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1075 list_name =
"/atmos_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1077 list_name =
"/ocean_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1079 list_name =
"/ice_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1081 list_name =
"/land_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1083 list_name =
"/default/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1090 if (
present(control) )
then
1091 if ( len_trim(control_tr)>len(control) )
then
1092 write(chn,*)len(control)
1093 write(chn1,*)len_trim(control_tr)
1094 if(error_handler(
'query_method', &
1095 ' Output string length ('//trim(adjustl(chn)) &
1096 //
') is not enough to return all "control" parameters ("'//trim(control_tr) &
1097 //
'", length='//trim(adjustl(chn1))//
')', &
1100 control = trim(control_tr)
1115 integer,
intent(in) :: model
1116 character(len=*),
intent(in) :: name
1117 character(len=*),
intent(in),
optional :: longname
1118 character(len=*),
intent(in),
optional :: units
1122 character(len=128) :: list_name
1125 tracers(tracer_array(model,n))%tracer_units = units
1126 tracers(tracer_array(model,n))%tracer_longname = longname
1129 list_name =
"/coupler_mod/tracer/"//trim(name)
1131 list_name =
"/atmos_mod/tracer/"//trim(name)
1133 list_name =
"/ocean_mod/tracer/"//trim(name)
1135 list_name =
"/land_mod/tracer/"//trim(name)
1137 list_name =
"/ice_mod/tracer/"//trim(name)
1139 list_name =
"/"//trim(name)
1146 if (
present(longname) )
then
1147 if ( longname .ne.
"" ) index =
fm_new_value(
'longname',longname)
1149 if (
present(units) )
then
1150 if (units .ne.
"" ) index =
fm_new_value(
'units',units)
1155 call mpp_error(note,
'set_tracer_atts : Trying to set longname and/or units for non-existent tracer : '//trim(name))
1163 integer,
intent(in) :: model
1164 character(len=*),
intent(in) :: name
1166 character(len=*),
intent(in) :: method_name
1167 character(len=*),
intent(in) :: method_control
1169 integer :: n, num_method, index
1171 character(len=128) :: list_name
1174 tracers(n)%num_methods = tracers(n)%num_methods + 1
1175 num_method = tracers(n)%num_methods
1179 list_name =
"/coupler_mod/tracer/"//trim(name)
1181 list_name =
"/atmos_mod/tracer/"//trim(name)
1183 list_name =
"/ocean_mod/tracer/"//trim(name)
1185 list_name =
"/land_mod/tracer/"//trim(name)
1187 list_name =
"/ice_mod/tracer/"//trim(name)
1189 list_name =
"/"//trim(name)
1192 if ( method_control .ne.
"" )
then
1194 list_name = trim(list_name)//
"/"//trim(
method_type)
1200 call mpp_error(note,
'set_tracer_method : Trying to set a method for non-existent tracer : '//trim(name))
1206 function error_handler(routine, err_msg_local, err_msg)
1207 logical :: error_handler
1208 character(len=*),
intent(in) :: routine, err_msg_local
1209 character(len=*),
intent(out),
optional :: err_msg
1211 if(
present(err_msg))
then
1212 err_msg = err_msg_local
1213 error_handler = .true.
1215 call mpp_error(fatal,trim(routine)//
': '//trim(err_msg_local))
1218 end function error_handler
1220 #include "tracer_manager_r4.fh"
1221 #include "tracer_manager_r8.fh"
1223 end module tracer_manager_mod
integer function, public fm_copy_list(list_name, suffix, create)
A function that allows the user to copy a field and add a suffix to the name of the new field.
integer, parameter, public model_land
Land model.
logical function, public fm_exists(name)
A function to test whether a named field exists.
character(len=11), dimension(num_models), parameter, public model_names
Model names, e.g. MODEL_NAMES(MODEL_OCEAN) is 'oceanic'.
logical function, public fm_change_list(name)
Change the current list. Return true on success, false otherwise.
subroutine, public get_field_methods(n, methods)
A routine to obtain all the methods associated with a field.
subroutine, public field_manager_init(nfields, table_name)
Routine to initialize the field manager.
logical function, public fm_query_method(name, method_name, method_control)
This is a function that provides the capability to return parameters associated with a field in a pai...
integer, parameter, public model_coupler
Ice model.
subroutine, public get_field_info(n, fld_type, fld_name, model, num_methods)
This routine allows access to field information given an index.
logical function, public fm_modify_name(oldname, newname)
This function allows a user to rename a field without modifying the contents of the field.
integer, parameter, public model_ocean
Ocean model.
integer, parameter, public model_ice
Ice model.
integer, parameter, public model_atmos
Atmospheric model.
integer, parameter, public num_models
Number of models (ATMOS, OCEAN, LAND, ICE, COUPLER).
An overloaded function to assign a value to a field.
A function to parse an integer or an array of integers, a real or an array of reals,...
This method_type is a way to allow a component module to alter the parameters it needs for various tr...
subroutine, public write_version_number(version, tag, unit)
Prints to the log file (or a specified unit) the version id string and tag name.
integer function stdlog()
This function returns the current standard fortran unit numbers for log messages. Log messages,...
integer function mpp_pe()
Returns processor ID.
subroutine, public tracer_manager_end
Uninitializes module and writes exit to logfile.
subroutine, public set_tracer_method(model, name, method_type, method_name, method_control)
A subroutine to allow the user to set some tracer specific methods.
subroutine, public get_tracer_indices(model, ind, prog_ind, diag_ind, fam_ind)
Routine to return the component model tracer indices as defined within the tracer manager.
subroutine, public get_tracer_names(model, n, name, longname, units, err_msg)
Routine to find the names associated with a tracer number.
logical function, public query_method(method_type, model, n, name, control, err_msg)
A function to query the schemes associated with each tracer.
logical function, public get_tracer_name(model, n, name, longname, units, err_msg)
Routine to find the names associated with a tracer number.
logical function, public adjust_mass(model, n, err_msg)
Function to check whether tracer should have its mass adjusted.
subroutine, public set_tracer_atts(model, name, longname, units)
A subroutine to allow the user set the tracer longname and units from the tracer initialization routi...
logical function, public check_if_prognostic(model, n, err_msg)
Function to see if a tracer is prognostic or diagnostic.
subroutine print_tracer_info(model, n)
Routine to print out the components of the tracer. This is useful for informational purposes....
subroutine get_tracer_meta_data(model, num_tracers, num_prog, num_diag)
Read in tracer table and store tracer information associated with "model" in "tracers" array.
subroutine, public register_tracers(model, num_tracers, num_prog, num_diag, num_family)
Not necessary to call, only needed for backward compatability.
integer function get_tracer_index_integer(model, name, indices, verbose)
Function which returns the number assigned to the tracer name.
logical function get_tracer_index_logical(model, name, index, indices, verbose)
Checks if tracer is present, and returns it's position in index.
subroutine, public tracer_manager_init
Not necessary to call, only needed for backward compatability.
subroutine, public get_number_tracers(model, num_tracers, num_prog, num_diag, num_family)
A routine to return the number of tracers included in a component model.
Function which returns the number assigned to the tracer name.
Private type to represent named instances.
Private type to holds string data for a tracer.
Private type to hold metadata for a tracer.