42 module tracer_manager_mod
53 use fms_mod,
only : lowercase, &
75 use platform_mod,
only : r4_kind, &
96 adjust_positive_def, &
131 module procedure set_tracer_profile_r4
132 module procedure set_tracer_profile_r8
138 character(len=32) :: tracer_name, tracer_units
139 character(len=128) :: tracer_longname
140 integer :: num_methods, model, instances
141 logical :: is_prognostic, instances_set
142 logical :: needs_init
145 logical :: needs_mass_adjust
146 logical :: needs_positive_adjust
152 character(len=32) :: model_name, tracer_name, tracer_units
153 character(len=128) :: tracer_longname
159 character(len=128) :: name
166 integer :: num_tracer_fields = 0
167 integer,
parameter :: MAX_TRACER_FIELDS = 250
168 integer,
parameter :: MAX_TRACER_METHOD = 20
169 integer,
parameter :: NO_TRACER = 1-huge(1)
170 integer,
parameter :: NOTRACER = -huge(1)
172 type(tracer_type),
save :: tracers(MAX_TRACER_FIELDS)
173 type(inst_type) ,
save :: instantiations(MAX_TRACER_FIELDS)
175 integer :: total_tracers(NUM_MODELS), prog_tracers(NUM_MODELS), diag_tracers(NUM_MODELS)
176 logical :: model_registered(NUM_MODELS) = .false.
179 #include<file_version.h>
181 logical :: module_is_initialized = .false.
183 logical :: verbose_local
184 integer :: TRACER_ARRAY(NUM_MODELS,MAX_TRACER_FIELDS)
194 integer :: model, num_tracers, num_prog, num_diag
196 if(module_is_initialized)
return
197 module_is_initialized = .true.
201 tracer_array = notracer
202 do model=1,num_models
212 integer,
intent(in) :: model
213 integer,
intent(out) :: num_tracers, num_prog, num_diag
214 character(len=256) :: warnmesg
216 character(len=32) :: name_type,
type, name
217 integer :: n, m, mod, num_tracer_methods, nfields, swop
218 integer :: j, log_unit, num_methods
220 type(
method_type),
dimension(MAX_TRACER_METHOD) :: methods
221 integer :: instances, siz_inst,i
222 character(len = 32) :: digit,suffnam
224 character(len=128) :: list_name , control
225 integer :: index_list_name
226 logical :: fm_success
239 if ( model_registered(model) )
then
242 num_tracers = total_tracers(model)
243 num_prog = prog_tracers(model)
244 num_diag = diag_tracers(model)
249 num_tracers = 0; num_prog = 0; num_diag = 0
257 if (nfields == 0 )
then
258 if (
mpp_pe() == mpp_root_pe()) &
259 call mpp_error(note,
'tracer_manager_init : No tracers are available to be registered.')
264 total_tracers(model) = 0
269 if (mod == model .and.
type ==
'tracer') then
270 num_tracer_fields = num_tracer_fields + 1
271 total_tracers(model) = total_tracers(model) + 1
275 if(num_tracer_fields > max_tracer_fields)
call mpp_error(fatal, &
276 &
'tracer_manager_init: MAX_TRACER_FIELDS exceeded')
277 tracer_array(model,total_tracers(model)) = num_tracer_fields
278 tracers(num_tracer_fields)%model = model
279 tracers(num_tracer_fields)%tracer_name = name
280 tracers(num_tracer_fields)%tracer_units =
'none'
281 tracers(num_tracer_fields)%tracer_longname = tracers(num_tracer_fields)%tracer_name
282 tracers(num_tracer_fields)%instances_set = .false.
286 tracers(num_tracer_fields)%needs_mass_adjust = .true.
287 tracers(num_tracer_fields)%needs_positive_adjust = .true.
288 if (name ==
'cld_amt')
then
289 tracers(num_tracer_fields)%needs_mass_adjust = .false.
291 if (name ==
'cld_amt' .or. name ==
'liq_wat' .or. name ==
'ice_wat')
then
292 tracers(num_tracer_fields)%needs_positive_adjust = .false.
295 num_tracer_methods = 0
296 methods = default_method
299 select case (methods(j)%method_type)
301 tracers(num_tracer_fields)%tracer_units = methods(j)%method_name
303 tracers(num_tracer_fields)%tracer_longname = methods(j)%method_name
306 siz_inst =
parse(methods(j)%method_name,
"",instances)
307 tracers(num_tracer_fields)%instances = instances
308 tracers(num_tracer_fields)%instances_set = .true.
310 if (methods(j)%method_name ==
"false")
then
311 tracers(num_tracer_fields)%needs_mass_adjust = .false.
313 case (
'adjust_positive_def')
314 if (methods(j)%method_name ==
"false")
then
315 tracers(num_tracer_fields)%needs_positive_adjust = .false.
318 num_tracer_methods = num_tracer_methods+1
322 tracers(num_tracer_fields)%num_methods = num_tracer_methods
323 tracers(num_tracer_fields)%needs_init = .false.
324 flag_type =
query_method(
'tracer_type',model,total_tracers(model),name_type)
325 if (flag_type .and. name_type ==
'diagnostic')
then
326 tracers(num_tracer_fields)%is_prognostic = .false.
328 tracers(num_tracer_fields)%is_prognostic = .true.
330 if (tracers(num_tracer_fields)%is_prognostic)
then
331 num_prog = num_prog+1
333 num_diag = num_diag+1
340 do n = 1, num_tracer_fields
343 if ( model == tracers(n)%model .and. tracers(n)%instances_set )
then
345 if ( num_tracer_fields + tracers(n)%instances > max_tracer_fields )
then
346 write(warnmesg,
'("tracer_manager_init: Number of tracers will exceed MAX_TRACER_FIELDS with &
347 &multiple (",I3," instances) setup of tracer ",A)') tracers(n)%instances,tracers(n)%tracer_name
351 do i = 2, tracers(n)%instances
352 num_tracer_fields = num_tracer_fields + 1
353 total_tracers(model) = total_tracers(model) + 1
354 tracer_array(model,total_tracers(model)) = num_tracer_fields
356 tracers(num_tracer_fields) = tracers(n)
357 if (
query_method(
'instances', model,model_tracer_number(model,n),name, control))
then
360 write (suffnam,
'(''suffix'',i1)') i
361 siz_inst =
parse(control, suffnam,digit)
362 if (siz_inst == 0 )
then
363 write (digit,
'(''_'',i1)') i
365 digit =
"_"//trim(digit)
367 elseif (i .lt. 100)
then
368 write (suffnam,
'(''suffix'',i2)') i
369 siz_inst =
parse(control, suffnam,digit)
370 if (siz_inst == 0 )
then
371 write (digit,
'(''_'',i2)') i
373 digit =
"_"//trim(digit)
376 call mpp_error(fatal,
'tracer_manager_init: MULTIPLE_TRACER_SET_UP exceeds 100 for '// &
377 & tracers(n)%tracer_name )
382 list_name =
"/coupler_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
384 list_name =
"/atmos_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
386 list_name =
"/ocean_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
388 list_name =
"/ice_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
390 list_name =
"/land_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
392 list_name =
"/default/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
395 if (
mpp_pe() == mpp_root_pe() )
write (*,*)
"Creating list name = ",trim(list_name)//trim(digit)
397 index_list_name =
fm_copy_list(trim(list_name),digit, create = .true.)
398 tracers(num_tracer_fields)%tracer_name = trim(tracers(num_tracer_fields)%tracer_name)//trim(digit)
401 if (tracers(num_tracer_fields)%is_prognostic)
then
402 num_prog = num_prog+1
404 num_diag = num_diag+1
409 siz_inst =
parse(control,
"suffix1",digit)
410 if (siz_inst > 0 )
then
411 digit =
"_"//trim(digit)
413 fm_success =
fm_modify_name(trim(list_name), trim(tracers(n)%tracer_name)//trim(digit))
414 tracers(n)%tracer_name = trim(tracers(n)%tracer_name)//trim(digit)
422 if ( mod == model .and.
type ==
'instances' ) then
427 call mpp_error(fatal,
'tracer_manager_init: The instances keyword was found for undefined tracer '&
428 //trim(methods(j)%method_type))
430 if ( tracers(m)%instances_set ) &
431 call mpp_error(fatal,
'tracer_manager_init: The instances keyword was found for '&
432 //trim(methods(j)%method_type)//
' but has previously been defined in the tracer entry')
433 siz_inst =
parse(methods(j)%method_name,
"",instances)
434 tracers(m)%instances = instances
435 call mpp_error(note,
'tracer_manager_init: '//trim(instantiations(j)%name)// &
436 ' will have '//trim(methods(j)%method_name)//
' instances')
438 if ( num_tracer_fields + instances > max_tracer_fields )
then
439 write(warnmesg,
'("tracer_manager_init: Number of tracers will exceed MAX_TRACER_FIELDS with &
440 &multiple (",I3," instances) setup of tracer ",A)') tracers(m)%instances,tracers(m)%tracer_name
445 if (instances .eq. 1)
then
446 siz_inst =
parse(methods(j)%method_control,
'suffix1',digit)
447 if (siz_inst == 0 )
then
450 digit =
"_"//trim(digit)
454 num_tracer_fields = num_tracer_fields + 1
455 total_tracers(model) = total_tracers(model) + 1
456 tracer_array(model,total_tracers(model)) = num_tracer_fields
457 tracers(num_tracer_fields) = tracers(m)
460 write (suffnam,
'(''suffix'',i1)') i
461 siz_inst =
parse(methods(j)%method_control, suffnam,digit)
462 if (siz_inst == 0 )
then
463 write (digit,
'(''_'',i1)') i
465 digit =
"_"//trim(digit)
467 elseif (i .lt. 100)
then
468 write (suffnam,
'(''suffix'',i2)') i
469 siz_inst =
parse(methods(j)%method_control, suffnam,digit)
470 if (siz_inst == 0 )
then
471 write (digit,
'(''_'',i2)') i
473 digit =
"_"//trim(digit)
476 call mpp_error(fatal,
'tracer_manager_init: MULTIPLE_TRACER_SET_UP exceeds 100 for '&
477 //tracers(num_tracer_fields)%tracer_name )
482 list_name =
"/coupler_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
484 list_name =
"/atmos_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
486 list_name =
"/ocean_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
488 list_name =
"/ice_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
490 list_name =
"/land_mod/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
492 list_name =
"/default/tracer/"//trim(tracers(num_tracer_fields)%tracer_name)
495 if (
mpp_pe() == mpp_root_pe() )
write (*,*)
"Creating list name = ",trim(list_name)
497 index_list_name =
fm_copy_list(trim(list_name),digit, create = .true.)
499 tracers(num_tracer_fields)%tracer_name = trim(tracers(num_tracer_fields)%tracer_name)//digit
500 if (tracers(num_tracer_fields)%is_prognostic)
then
501 num_prog = num_prog+1
503 num_diag = num_diag+1
507 siz_inst =
parse(methods(j)%method_control,
'suffix1',digit)
508 if (siz_inst == 0 )
then
511 digit =
"_"//trim(digit)
513 fm_success =
fm_modify_name(trim(list_name), trim(tracers(m)%tracer_name)//trim(digit))
514 tracers(m)%tracer_name = trim(tracers(m)%tracer_name)//trim(digit)
519 num_tracers = num_prog + num_diag
521 total_tracers(model) = num_tracers
522 prog_tracers(model) = num_prog
523 diag_tracers(model) = num_diag
524 model_registered(model) = .true.
532 do m = n, num_tracers
534 swop = tracer_array(model,n)
535 tracer_array(model,n) = tracer_array(model,m)
536 tracer_array(model,m) = swop
543 do n=1, num_tracer_fields
548 if (
mpp_pe() == mpp_root_pe() )
then
549 write (log_unit,15) trim(
model_names(model)),total_tracers(model)
552 15
format (
'Number of tracers in field table for ',a,
' model = ',i4)
556 function model_tracer_number(model,n)
557 integer,
intent(in) :: model, n
558 integer model_tracer_number
562 model_tracer_number = no_tracer
564 do i = 1, max_tracer_fields
565 if ( tracer_array(model,i) == n )
then
566 model_tracer_number = i
571 end function model_tracer_number
579 integer,
intent(in) :: model
580 integer,
intent(out) :: num_tracers
581 integer,
intent(out) :: num_prog
582 integer,
intent(out) :: num_diag
583 integer,
intent(out),
optional :: num_family
599 integer,
intent(in) :: model
600 integer,
intent(out),
optional :: num_tracers
602 integer,
intent(out),
optional :: num_prog
604 integer,
intent(out),
optional :: num_diag
606 integer,
intent(out),
optional :: num_family
616 call mpp_error(fatal,
"get_number_tracers : Model number is invalid.")
618 if (
present(num_tracers)) num_tracers = total_tracers(model)
619 if (
present(num_prog)) num_prog = prog_tracers(model)
620 if (
present(num_diag)) num_diag = diag_tracers(model)
621 if (
present(num_family)) num_family = 0
642 integer,
intent(in) :: model
643 integer,
intent(out),
dimension(:),
optional :: ind, prog_ind, diag_ind, fam_ind
645 integer :: i, j, np, nd, n
652 if (
PRESENT(ind)) ind = no_tracer
653 if (
PRESENT(prog_ind)) prog_ind = no_tracer
654 if (
PRESENT(diag_ind)) diag_ind = no_tracer
655 if (
PRESENT(fam_ind)) fam_ind = no_tracer
657 do i = 1, max_tracer_fields
658 j = tracer_array(model,i)
659 if ( j /= notracer)
then
660 if ( model == tracers(j)%model)
then
661 if (
PRESENT(ind))
then
666 if (n >
size(ind(:)))
call mpp_error(fatal, &
667 &
'get_tracer_indices : index array size too small in get_tracer_indices')
671 if (tracers(j)%is_prognostic.and.
PRESENT(prog_ind))
then
676 if ( np >
size( prog_ind(:)))
call mpp_error(fatal,&
677 'get_tracer_indices : prognostic array size too small in get_tracer_indices')
679 else if (.not.tracers(j)%is_prognostic .and.
PRESENT(diag_ind))
then
684 if (nd >
size(diag_ind(:)))
call mpp_error(fatal,&
685 'get_tracer_indices : diagnostic array size too small in get_tracer_indices')
740 integer,
intent(in) :: model
741 character(len=*),
intent(in) :: name
742 integer,
intent(in),
dimension(:),
optional :: indices
744 logical,
intent(in),
optional :: verbose
753 if (
PRESENT(indices))
then
754 do i = 1,
size(indices(:))
755 if (model == tracers(indices(i))%model .and. lowercase(trim(name)) == trim(tracers(indices(i))%tracer_name))
then
761 do i=1, num_tracer_fields
762 if(tracer_array(model,i) == notracer) cycle
763 if (lowercase(trim(name)) == trim(tracers(tracer_array(model,i))%tracer_name))
then
770 verbose_local=.false.
771 if (
present(verbose)) verbose_local=verbose
773 if (verbose_local)
then
776 call mpp_error(note,
'get_tracer_index : tracer with this name not found: '//trim(name))
789 integer,
intent(in) :: model
790 character(len=*),
intent(in) :: name
791 integer,
intent(out) :: index
792 integer,
intent(in),
dimension(:),
optional :: indices
793 logical,
intent(in),
optional :: verbose
797 if(index == no_tracer)
then
813 if (
mpp_pe() == mpp_root_pe() )
then
814 write (log_unit,
'(/,(a))')
'Exiting tracer_manager, have a nice day ...'
817 module_is_initialized = .false.
827 integer,
intent(in) :: model
828 integer,
intent(in) :: n
829 integer :: i, log_unit
833 if(
mpp_pe()==mpp_root_pe() .and. tracer_array(model,n)> 0 )
then
834 i = tracer_array(model,n)
836 write(log_unit, *)
'----------------------------------------------------'
837 write(log_unit, *)
'Contents of tracer entry ', i
838 write(log_unit, *)
'Model type and field name'
839 write(log_unit, *)
'Model : ', tracers(i)%model
840 write(log_unit, *)
'Field name : ', trim(tracers(i)%tracer_name)
841 write(log_unit, *)
'Tracer units : ', trim(tracers(i)%tracer_units)
842 write(log_unit, *)
'Tracer longname : ', trim(tracers(i)%tracer_longname)
843 write(log_unit, *)
'Tracer is_prognostic : ', tracers(i)%is_prognostic
844 write(log_unit, *)
'----------------------------------------------------'
857 integer,
intent(in) :: model
858 integer,
intent(in) :: n
859 character (len=*),
intent(out) :: name
860 character (len=*),
intent(out),
optional :: longname
861 character (len=*),
intent(out),
optional :: units
862 character (len=*),
intent(out),
optional :: err_msg
863 character (len=128) :: err_msg_local
865 character(len=11) :: chn
869 if (n < 1 .or. n > total_tracers(model))
then
870 write(chn,
'(i11)') n
871 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
872 if(error_handler(
'get_tracer_names', err_msg_local, err_msg))
return
874 n1 = tracer_array(model,n)
876 name = trim(tracers(n1)%tracer_name)
877 if (
PRESENT(longname)) longname = trim(tracers(n1)%tracer_longname)
878 if (
PRESENT(units)) units = trim(tracers(n1)%tracer_units)
891 integer,
intent(in) :: model
892 integer,
intent(in) :: n
893 character (len=*),
intent(out) :: name
894 character (len=*),
intent(out),
optional :: longname
895 character (len=*),
intent(out),
optional :: units
896 character (len=*),
intent(out),
optional :: err_msg
906 character (len=128) :: err_msg_local
908 character(len=11) :: chn
912 if (n < 1 .or. n > total_tracers(model))
then
913 write(chn,
'(i11)') n
914 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
915 if(error_handler(
'get_tracer_name', err_msg_local, err_msg))
then
922 n1 = tracer_array(model,n)
924 name = trim(tracers(n1)%tracer_name)
925 if (
PRESENT(longname)) longname = trim(tracers(n1)%tracer_longname)
926 if (
PRESENT(units)) units = trim(tracers(n1)%tracer_units)
942 integer,
intent(in) :: model
943 integer,
intent(in) :: n
945 character(len=*),
intent(out),
optional :: err_msg
946 character(len=128) :: err_msg_local
947 character(len=11) :: chn
951 if (n < 1 .or. n > total_tracers(model))
then
952 write(chn,
'(i11)') n
953 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
955 if(error_handler(
'check_if_prognostic', err_msg_local, err_msg))
return
969 integer,
intent(in) :: model, n
971 character(len=*),
intent(out),
optional :: err_msg
972 character(len=128) :: err_msg_local
973 character(len=11) :: chn
977 if (n < 1 .or. n > total_tracers(model))
then
978 write(chn,
'(i11)') n
979 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
981 if(error_handler(
'adjust_mass', err_msg_local, err_msg))
return
986 adjust_mass = tracers(tracer_array(model,n))%needs_mass_adjust
991 function adjust_positive_def(model, n, err_msg)
993 integer,
intent(in) :: model, n
994 logical :: adjust_positive_def
995 character(len=*),
intent(out),
optional :: err_msg
996 character(len=128) :: err_msg_local
997 character(len=11) :: chn
1001 if (n < 1 .or. n > total_tracers(model))
then
1002 write(chn,
'(i11)') n
1003 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
1004 adjust_positive_def = .true.
1005 if(error_handler(
'adjust_positive_def', err_msg_local, err_msg))
return
1010 adjust_positive_def = tracers(tracer_array(model,n))%needs_positive_adjust
1012 end function adjust_positive_def
1044 integer ,
intent(in) :: model
1045 integer ,
intent(in) :: n
1046 character(len=*),
intent(out) :: name
1049 character(len=*),
intent(out),
optional :: control
1051 character(len=*),
intent(out),
optional :: err_msg
1055 character(len=256) :: list_name
1056 character(len=1024):: control_tr
1057 character(len=16) :: chn,chn1
1058 character(len=128) :: err_msg_local
1064 if (n < 1 .or. n > total_tracers(model))
then
1065 write(chn,
'(i11)') n
1066 err_msg_local =
' Invalid tracer index. Model name = '//trim(
model_names(model))//
', Index='//trim(chn)
1067 if(error_handler(
'query_method', err_msg_local, err_msg))
return
1070 n1 = tracer_array(model,n)
1074 list_name =
"/coupler_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1076 list_name =
"/atmos_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1078 list_name =
"/ocean_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1080 list_name =
"/ice_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1082 list_name =
"/land_mod/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1084 list_name =
"/default/tracer/"//trim(tracers(n1)%tracer_name)//
"/"//trim(
method_type)
1091 if (
present(control) )
then
1092 if ( len_trim(control_tr)>len(control) )
then
1093 write(chn,*)len(control)
1094 write(chn1,*)len_trim(control_tr)
1095 if(error_handler(
'query_method', &
1096 ' Output string length ('//trim(adjustl(chn)) &
1097 //
') is not enough to return all "control" parameters ("'//trim(control_tr) &
1098 //
'", length='//trim(adjustl(chn1))//
')', &
1101 control = trim(control_tr)
1116 integer,
intent(in) :: model
1117 character(len=*),
intent(in) :: name
1118 character(len=*),
intent(in),
optional :: longname
1119 character(len=*),
intent(in),
optional :: units
1123 character(len=128) :: list_name
1126 tracers(tracer_array(model,n))%tracer_units = units
1127 tracers(tracer_array(model,n))%tracer_longname = longname
1130 list_name =
"/coupler_mod/tracer/"//trim(name)
1132 list_name =
"/atmos_mod/tracer/"//trim(name)
1134 list_name =
"/ocean_mod/tracer/"//trim(name)
1136 list_name =
"/land_mod/tracer/"//trim(name)
1138 list_name =
"/ice_mod/tracer/"//trim(name)
1140 list_name =
"/"//trim(name)
1147 if (
present(longname) )
then
1148 if ( longname .ne.
"" ) index =
fm_new_value(
'longname',longname)
1150 if (
present(units) )
then
1151 if (units .ne.
"" ) index =
fm_new_value(
'units',units)
1156 call mpp_error(note,
'set_tracer_atts : Trying to set longname and/or units for non-existent tracer : '//trim(name))
1164 integer,
intent(in) :: model
1165 character(len=*),
intent(in) :: name
1167 character(len=*),
intent(in) :: method_name
1168 character(len=*),
intent(in) :: method_control
1170 integer :: n, num_method, index
1172 character(len=128) :: list_name
1175 tracers(n)%num_methods = tracers(n)%num_methods + 1
1176 num_method = tracers(n)%num_methods
1180 list_name =
"/coupler_mod/tracer/"//trim(name)
1182 list_name =
"/atmos_mod/tracer/"//trim(name)
1184 list_name =
"/ocean_mod/tracer/"//trim(name)
1186 list_name =
"/land_mod/tracer/"//trim(name)
1188 list_name =
"/ice_mod/tracer/"//trim(name)
1190 list_name =
"/"//trim(name)
1193 if ( method_control .ne.
"" )
then
1195 list_name = trim(list_name)//
"/"//trim(
method_type)
1201 call mpp_error(note,
'set_tracer_method : Trying to set a method for non-existent tracer : '//trim(name))
1207 function error_handler(routine, err_msg_local, err_msg)
1208 logical :: error_handler
1209 character(len=*),
intent(in) :: routine, err_msg_local
1210 character(len=*),
intent(out),
optional :: err_msg
1212 if(
present(err_msg))
then
1213 err_msg = err_msg_local
1214 error_handler = .true.
1216 call mpp_error(fatal,trim(routine)//
': '//trim(err_msg_local))
1219 end function error_handler
1221 #include "tracer_manager_r4.fh"
1222 #include "tracer_manager_r8.fh"
1224 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.