9 #include <PB3D_macros.h>
29 real(dp),
allocatable :: dum_1D(:)
30 real(dp),
allocatable :: dum_2D(:,:)
31 real(dp),
allocatable :: dum_3D(:,:,:)
32 real(dp),
allocatable :: dum_4D(:,:,:,:)
33 real(dp),
allocatable :: dum_6D(:,:,:,:,:,:)
34 real(dp),
allocatable :: dum_7D(:,:,:,:,:,:,:)
57 use vmec_vars,
only: is_freeb_v, mnmax_v, mpol_v, ntor_v, is_asym_v, &
66 character(*),
parameter :: rout_name =
'reconstruct_PB3D_in'
69 character(len=*),
intent(in) :: data_name
72 character(len=max_str_ln) :: err_msg
74 real(dp),
parameter :: tol_version = 1.e-4_dp
75 real(dp) :: pb3d_version
76 logical :: debug_version_pb3d
77 character(len=max_str_ln) :: use_debug_str(2)
83 call writo(
'Reconstructing input variables from PB3D output')
90 pb3d_version = dum_1d(1)
112 debug_version_pb3d = .false.
113 if (dum_1d(20).gt.0) debug_version_pb3d = .true.
121 call writo(
'Run tests')
124 call writo(
'PB3D version '//trim(
r2strt(pb3d_version)))
125 if (pb3d_version.lt.min_pb3d_version*(1-tol_version))
then
127 err_msg =
'Need at least PB3D version '//&
128 &trim(
r2strt(min_pb3d_version))
132 if (debug_version_pb3d)
call writo(
'debug version')
136 if (debug_version_pb3d)
then
137 use_debug_str(1) =
'uses debug version'
139 use_debug_str(1) =
'uses release version'
142 use_debug_str(2) =
'uses debug version'
144 use_debug_str(2) =
'uses release version'
146 call writo(
'The PB3D output '//trim(use_debug_str(1))//&
147 &
' but POST '//trim(use_debug_str(2)))
148 err_msg =
'Need to use debug version for both, or not for &
166 if (dum_1d(1).gt.0) is_asym_v = .true.
167 if (dum_1d(2).gt.0) is_freeb_v = .true.
168 mnmax_v = nint(dum_1d(3))
169 mpol_v = nint(dum_1d(4))
170 ntor_v = nint(dum_1d(5))
171 nfp_v = nint(dum_1d(6))
221 allocate(mn_v(mnmax_v,2))
235 r_v_c = dum_4d(:,:,:,1)
236 r_v_s = dum_4d(:,:,:,2)
237 z_v_c = dum_4d(:,:,:,3)
238 z_v_s = dum_4d(:,:,:,4)
239 l_v_c = dum_4d(:,:,:,5)
240 l_v_s = dum_4d(:,:,:,6)
249 jac_v_c = dum_4d(:,:,:,1)
250 jac_v_s = dum_4d(:,:,:,2)
257 allocate(b_v_sub_c(mnmax_v,
n_r_eq,3))
258 allocate(b_v_sub_s(mnmax_v,
n_r_eq,3))
259 b_v_sub_c = dum_4d(:,:,:,1)
260 b_v_sub_s = dum_4d(:,:,:,2)
270 b_v_c = dum_3d(:,:,1)
271 b_v_s = dum_3d(:,:,2)
289 ias = nint(dum_1d(1))
290 nchi= nint(dum_1d(2))
297 allocate(r_h(nchi,
n_r_eq))
298 allocate(z_h(nchi,
n_r_eq))
307 allocate(chi_h(nchi))
418 call writo(
'Input variables from PB3D output reconstructed')
441 &lim_pos,grid_limits)
result(ierr)
447 character(*),
parameter :: rout_name =
'reconstruct_PB3D_grid'
451 character(len=*),
intent(in) :: data_name
452 integer,
intent(in),
optional :: rich_lvl
453 logical,
intent(in),
optional :: tot_rich
454 integer,
intent(in),
optional :: lim_pos(3,2)
455 integer,
intent(in),
optional :: grid_limits(2)
459 integer :: lim_mem(3,2)
462 integer :: rich_lvl_loc
464 integer :: par_id_mem(2)
465 integer :: par_lim(2)
466 integer :: rich_id(2)
473 if (
present(rich_lvl)) rich_lvl_loc = rich_lvl
476 rich_id = setup_rich_id(rich_lvl_loc,tot_rich)
483 if (
present(lim_pos))
then
484 if (lim_pos(1,1).ge.0 .and. lim_pos(1,2).ge.0) n(1) = &
485 &lim_pos(1,2)-lim_pos(1,1)+1
486 if (lim_pos(2,1).ge.0 .and. lim_pos(2,2).ge.0) n(2) = &
487 &lim_pos(2,2)-lim_pos(2,1)+1
488 if (lim_pos(3,1).ge.0 .and. lim_pos(3,2).ge.0) n(3) = &
489 &lim_pos(3,2)-lim_pos(3,1)+1
490 where (lim_pos(:,1).eq.lim_pos(:,2) .and. lim_pos(:,1).eq.[0,0,0]) &
496 if (
present(lim_pos))
then
497 where (lim_pos(1,:).ge.0) par_lim = lim_pos(1,:)
501 ierr = grid%init(n,i_lim=grid_limits)
505 do id = rich_id(2),rich_id(1),-1
507 par_id = setup_par_id(grid,rich_lvl_loc,id,tot_rich=tot_rich,&
508 &par_lim=par_lim,par_id_mem=par_id_mem)
511 lim_mem(1,:) = par_id_mem
512 lim_mem(2,:) = [1,grid%n(2)]
513 lim_mem(3,:) = [1,grid%n(3)]
514 if (
present(lim_pos))
then
515 lim_mem(2,:) = lim_pos(2,:)
516 lim_mem(3,:) = lim_pos(3,:)
521 &trim(data_name),
'r_F',rich_lvl=id,lim_loc=lim_mem(3:3,:))
529 &trim(data_name),
'r_E',rich_lvl=id,lim_loc=lim_mem(3:3,:))
536 grid%loc_r_F = grid%r_F(grid%i_min:grid%i_max)
539 grid%loc_r_E = grid%r_E(grid%i_min:grid%i_max)
542 lim_mem(1,:) = par_id_mem
543 lim_mem(2,:) = [1,grid%n(2)]
544 lim_mem(3,:) = [grid%i_min,grid%i_max]
545 if (
present(lim_pos))
then
546 lim_mem(2,:) = lim_pos(2,:)
547 lim_mem(3,:) = lim_mem(3,:) + lim_pos(3,1) - 1
551 if (product(grid%n(1:2)).ne.0)
then
554 &trim(data_name),
'theta_F',rich_lvl=id,lim_loc=lim_mem)
557 grid%theta_F(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
562 &trim(data_name),
'theta_E',rich_lvl=id,lim_loc=lim_mem)
565 grid%theta_E(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
570 &trim(data_name),
'zeta_F',rich_lvl=id,lim_loc=lim_mem)
573 grid%zeta_F(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
578 &trim(data_name),
'zeta_E',rich_lvl=id,lim_loc=lim_mem)
581 grid%zeta_E(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
601 character(*),
parameter :: rout_name =
'reconstruct_PB3D_eq_1'
605 type(
eq_1_type),
intent(inout),
optional :: eq
606 character(len=*),
intent(in) :: data_name
607 integer,
intent(in),
optional :: lim_pos(1,2)
611 integer :: lim_mem(2,2)
619 call eq%init(grid_eq,setup_e=.false.,setup_f=.true.)
622 lim_mem(1,:) = [grid_eq%i_min,grid_eq%i_max]
623 lim_mem(2,:) = [0,-1]
624 if (
present(lim_pos))
then
625 lim_mem(1,:) = lim_mem(1,:) + lim_pos(1,1) - 1
659 eq%flux_p_FD = dum_2d
667 eq%flux_t_FD = dum_2d
672 &lim_loc=lim_mem(1:1,:))
694 &tot_rich,lim_pos)
result(ierr)
699 character(*),
parameter :: rout_name =
'reconstruct_PB3D_eq_2'
704 character(len=*),
intent(in) :: data_name
705 integer,
intent(in),
optional :: rich_lvl
706 logical,
intent(in),
optional :: tot_rich
707 integer,
intent(in),
optional :: lim_pos(3,2)
711 integer :: lim_mem(7,2)
713 integer :: rich_lvl_loc
715 integer :: par_id_mem(2)
716 integer :: par_lim(2)
717 integer :: rich_id(2)
724 if (
present(rich_lvl)) rich_lvl_loc = rich_lvl
727 rich_id = setup_rich_id(rich_lvl_loc,tot_rich)
730 par_lim = [1,grid_eq%n(1)]
731 if (
present(lim_pos))
then
732 where (lim_pos(1,:).ge.0) par_lim = lim_pos(1,:)
736 call eq%init(grid_eq,setup_e=.false.,setup_f=.true.)
739 do id = rich_id(2),rich_id(1),-1
741 par_id = setup_par_id(grid_eq,rich_lvl_loc,id,tot_rich=tot_rich,&
742 &par_lim=par_lim,par_id_mem=par_id_mem)
745 lim_mem(1,:) = par_id_mem
746 lim_mem(2,:) = [1,grid_eq%n(2)]
747 lim_mem(3,:) = [grid_eq%i_min,grid_eq%i_max]
748 lim_mem(4,:) = [-1,-1]
749 lim_mem(5,:) = [-1,-1]
750 lim_mem(6,:) = [-1,-1]
751 lim_mem(7,:) = [-1,-1]
752 if (
present(lim_pos))
then
753 lim_mem(2,:) = lim_pos(2,:)
754 lim_mem(3,:) = lim_mem(3,:) + lim_pos(3,1) - 1
759 &rich_lvl=id,lim_loc=lim_mem)
762 eq%g_FD(par_id(1):par_id(2):par_id(3),:,:,:,:,:,:) = dum_7d
767 &rich_lvl=id,lim_loc=lim_mem)
770 eq%h_FD(par_id(1):par_id(2):par_id(3),:,:,:,:,:,:) = dum_7d
775 &rich_lvl=id,lim_loc=lim_mem(1:6,:))
778 eq%jac_FD(par_id(1):par_id(2):par_id(3),:,:,:,:,:) = dum_6d
783 &rich_lvl=id,lim_loc=lim_mem(1:3,:))
786 eq%S(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
791 &
'kappa_n',rich_lvl=id,lim_loc=lim_mem(1:3,:))
794 eq%kappa_n(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
799 &
'kappa_g',rich_lvl=id,lim_loc=lim_mem(1:3,:))
802 eq%kappa_g(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
807 &rich_lvl=id,lim_loc=lim_mem(1:3,:))
810 eq%sigma(par_id(1):par_id(2):par_id(3),:,:) = dum_3d
832 &tot_rich,lim_sec_X,lim_pos)
result(ierr)
838 character(*),
parameter :: rout_name =
'reconstruct_PB3D_X_1'
844 character(len=*),
intent(in) :: data_name
845 integer,
intent(in),
optional :: rich_lvl
846 logical,
intent(in),
optional :: tot_rich
847 integer,
intent(in),
optional :: lim_sec_x(2)
848 integer,
intent(in),
optional :: lim_pos(3,2)
852 integer :: lim_sec_x_loc(2)
853 integer :: lim_mem(4,2)
855 integer :: rich_lvl_loc
857 integer :: par_id_mem(2)
858 integer :: par_lim(2)
859 integer :: rich_id(2)
866 if (
present(rich_lvl)) rich_lvl_loc = rich_lvl
869 rich_id = setup_rich_id(rich_lvl_loc,tot_rich)
873 if (
present(lim_sec_x)) lim_sec_x_loc = lim_sec_x
876 par_lim = [1,grid_x%n(1)]
877 if (
present(lim_pos))
then
878 where (lim_pos(1,:).ge.0) par_lim = lim_pos(1,:)
882 call x%init(mds,grid_x,lim_sec_x)
885 do id = rich_id(2),rich_id(1),-1
887 par_id = setup_par_id(grid_x,rich_lvl_loc,id,tot_rich=tot_rich,&
888 &par_lim=par_lim,par_id_mem=par_id_mem)
891 lim_mem(1,:) = par_id_mem
892 lim_mem(2,:) = [1,grid_x%n(2)]
893 lim_mem(3,:) = [grid_x%i_min,grid_x%i_max]
894 lim_mem(4,:) = lim_sec_x_loc
895 if (
present(lim_pos))
then
896 lim_mem(2,:) = lim_pos(2,:)
897 lim_mem(3,:) = lim_mem(3,:) + lim_pos(3,1) - 1
902 &
'RE_U_0',rich_lvl=id,lim_loc=lim_mem)
905 x%U_0(par_id(1):par_id(2):par_id(3),:,:,:) = dum_4d
910 &
'IM_U_0',rich_lvl=id,lim_loc=lim_mem)
913 x%U_0(par_id(1):par_id(2):par_id(3),:,:,:) = &
914 x%U_0(par_id(1):par_id(2):par_id(3),:,:,:) + iu*dum_4d
919 &
'RE_U_1',rich_lvl=id,lim_loc=lim_mem)
922 x%U_1(par_id(1):par_id(2):par_id(3),:,:,:) = dum_4d
927 &
'IM_U_1',rich_lvl=id,lim_loc=lim_mem)
930 x%U_1(par_id(1):par_id(2):par_id(3),:,:,:) = &
931 x%U_1(par_id(1):par_id(2):par_id(3),:,:,:) + iu*dum_4d
936 &
'RE_DU_0',rich_lvl=id,lim_loc=lim_mem)
939 x%DU_0(par_id(1):par_id(2):par_id(3),:,:,:) = dum_4d
944 &
'IM_DU_0',rich_lvl=id,lim_loc=lim_mem)
947 x%DU_0(par_id(1):par_id(2):par_id(3),:,:,:) = &
948 x%DU_0(par_id(1):par_id(2):par_id(3),:,:,:) + iu*dum_4d
953 &
'RE_DU_1',rich_lvl=id,lim_loc=lim_mem)
956 x%DU_1(par_id(1):par_id(2):par_id(3),:,:,:) = dum_4d
961 &
'IM_DU_1',rich_lvl=id,lim_loc=lim_mem)
964 x%DU_1(par_id(1):par_id(2):par_id(3),:,:,:) = &
965 x%DU_1(par_id(1):par_id(2):par_id(3),:,:,:) + iu*dum_4d
991 &tot_rich,lim_sec_X,lim_pos,is_field_averaged)
result(ierr)
997 character(*),
parameter :: rout_name =
'reconstruct_PB3D_X_2'
1003 character(len=*),
intent(in) :: data_name
1004 integer,
intent(in),
optional :: rich_lvl
1005 logical,
intent(in),
optional :: tot_rich
1006 integer,
intent(in),
optional :: lim_sec_x(2,2)
1007 integer,
intent(in),
optional :: lim_pos(3,2)
1008 logical,
intent(in),
optional :: is_field_averaged
1012 logical :: is_field_averaged_loc
1015 integer :: sxr_loc(2,2)
1016 integer :: sxr_tot(2,2)
1017 integer :: nn_mod_loc(2)
1018 integer :: lim_mem(4,2,2)
1019 integer :: rich_lvl_loc
1020 integer :: par_id(3)
1021 integer :: par_id_mem(2)
1022 integer :: par_lim(2)
1023 integer :: rich_id(2)
1024 logical :: read_this(2)
1031 if (
present(rich_lvl)) rich_lvl_loc = rich_lvl
1034 is_field_averaged_loc = .false.
1035 if (
present(is_field_averaged)) is_field_averaged_loc = &
1039 rich_id = setup_rich_id(rich_lvl_loc,tot_rich)
1042 par_lim = [1,grid_x%n(1)]
1043 if (
present(lim_pos))
then
1044 where (lim_pos(1,:).ge.0) par_lim = lim_pos(1,:)
1048 call x%init(mds,grid_x,lim_sec_x,is_field_averaged)
1051 do id = rich_id(2),rich_id(1),-1
1053 if (is_field_averaged_loc)
then
1057 par_id = setup_par_id(grid_x,rich_lvl_loc,id,tot_rich=tot_rich,&
1058 &par_lim=par_lim,par_id_mem=par_id_mem)
1068 nn_mod_loc = sxr_loc(2,:)-sxr_loc(1,:)+1
1071 if (sxr_loc(1,k).le.sxr_loc(2,k)) read_this(k) = .true.
1079 lim_mem(1,:,1) = par_id_mem
1080 lim_mem(2,:,1) = [1,grid_x%n(2)]
1081 lim_mem(3,:,1) = [grid_x%i_min,grid_x%i_max]
1082 lim_mem(4,:,1) = [sxr_tot(1,1),sxr_tot(2,1)]
1083 lim_mem(1,:,2) = par_id_mem
1084 lim_mem(2,:,2) = [1,grid_x%n(2)]
1085 lim_mem(3,:,2) = [grid_x%i_min,grid_x%i_max]
1086 lim_mem(4,:,2) = [sxr_tot(1,2),sxr_tot(2,2)]
1087 if (
present(lim_pos))
then
1088 lim_mem(2,:,1) = lim_pos(2,:)
1089 lim_mem(3,:,1) = lim_mem(3,:,1) + lim_pos(3,1) - 1
1090 lim_mem(2,:,2) = lim_pos(2,:)
1091 lim_mem(3,:,2) = lim_mem(3,:,2) + lim_pos(3,1) - 1
1094 if (read_this(1))
then
1097 &
'RE_PV_0',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1100 x%PV_0(par_id(1):par_id(2):par_id(3),:,:,&
1101 &sxr_loc(1,1):sxr_loc(2,1)) = dum_4d
1106 &
'IM_PV_0',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1109 x%PV_0(par_id(1):par_id(2):par_id(3),:,:,&
1110 &sxr_loc(1,1):sxr_loc(2,1)) = &
1111 &x%PV_0(par_id(1):par_id(2):par_id(3),:,:,&
1112 &sxr_loc(1,1):sxr_loc(2,1)) + iu*dum_4d
1117 &
'RE_PV_2',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1120 x%PV_2(par_id(1):par_id(2):par_id(3),:,:,&
1121 &sxr_loc(1,1):sxr_loc(2,1)) = dum_4d
1126 &
'IM_PV_2',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1129 x%PV_2(par_id(1):par_id(2):par_id(3),:,:,&
1130 &sxr_loc(1,1):sxr_loc(2,1)) = &
1131 &x%PV_2(par_id(1):par_id(2):par_id(3),:,:,&
1132 &sxr_loc(1,1):sxr_loc(2,1)) + iu*dum_4d
1137 &
'RE_KV_0',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1140 x%KV_0(par_id(1):par_id(2):par_id(3),:,:,&
1141 &sxr_loc(1,1):sxr_loc(2,1)) = dum_4d
1146 &
'IM_KV_0',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1149 x%KV_0(par_id(1):par_id(2):par_id(3),:,:,&
1150 &sxr_loc(1,1):sxr_loc(2,1)) = &
1151 &x%KV_0(par_id(1):par_id(2):par_id(3),:,:,&
1152 &sxr_loc(1,1):sxr_loc(2,1)) + iu*dum_4d
1157 &
'RE_KV_2',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1160 x%KV_2(par_id(1):par_id(2):par_id(3),:,:,&
1161 &sxr_loc(1,1):sxr_loc(2,1)) = dum_4d
1166 &
'IM_KV_2',rich_lvl=id,lim_loc=lim_mem(:,:,1))
1169 x%KV_2(par_id(1):par_id(2):par_id(3),:,:,&
1170 &sxr_loc(1,1):sxr_loc(2,1)) = &
1171 &x%KV_2(par_id(1):par_id(2):par_id(3),:,:,&
1172 &sxr_loc(1,1):sxr_loc(2,1)) + iu*dum_4d
1176 if (read_this(2))
then
1179 &
'RE_PV_1',rich_lvl=id,lim_loc=lim_mem(:,:,2))
1182 x%PV_1(par_id(1):par_id(2):par_id(3),:,:,&
1183 &sxr_loc(1,2):sxr_loc(2,2)) = dum_4d
1188 &
'IM_PV_1',rich_lvl=id,lim_loc=lim_mem(:,:,2))
1191 x%PV_1(par_id(1):par_id(2):par_id(3),:,:,&
1192 &sxr_loc(1,2):sxr_loc(2,2)) = &
1193 &x%PV_1(par_id(1):par_id(2):par_id(3),:,:,&
1194 &sxr_loc(1,2):sxr_loc(2,2)) + iu*dum_4d
1199 &
'RE_KV_1',rich_lvl=id,lim_loc=lim_mem(:,:,2))
1202 x%KV_1(par_id(1):par_id(2):par_id(3),:,:,&
1203 &sxr_loc(1,2):sxr_loc(2,2)) = dum_4d
1208 &
'IM_KV_1',rich_lvl=id,lim_loc=lim_mem(:,:,2))
1211 x%KV_1(par_id(1):par_id(2):par_id(3),:,:,&
1212 &sxr_loc(1,2):sxr_loc(2,2)) = &
1213 &x%KV_1(par_id(1):par_id(2):par_id(3),:,:,&
1214 &sxr_loc(1,2):sxr_loc(2,2)) + iu*dum_4d
1233 character(*),
parameter :: rout_name =
'reconstruct_PB3D_vac'
1236 type(
vac_type),
intent(inout) :: vac
1237 character(len=*),
intent(in) :: data_name
1238 integer,
intent(in),
optional :: rich_lvl
1242 integer :: rich_lvl_loc
1254 if (
present(rich_lvl)) rich_lvl_loc = rich_lvl
1258 &rich_lvl=rich_lvl_loc)
1261 style = nint(dum_1d(1))
1262 n_bnd = nint(dum_1d(2))
1263 prim_x = nint(dum_1d(3))
1264 n_ang = nint(dum_1d(4:5))
1269 ierr = vac%init(style,n_bnd,prim_x,n_ang,jq)
1274 &
'sec_X',rich_lvl=rich_lvl_loc)
1277 vac%sec_X = nint(dum_1d)
1283 &
'norm',rich_lvl=rich_lvl_loc)
1291 &
'x_vec',rich_lvl=rich_lvl_loc)
1298 select case (vac%style)
1302 &
'h_fac',rich_lvl=rich_lvl_loc)
1310 &
'ang',rich_lvl=rich_lvl_loc)
1318 &
'dnorm',rich_lvl=rich_lvl_loc)
1328 &
'RE_res',rich_lvl=rich_lvl_loc)
1336 &
'IM_res',rich_lvl=rich_lvl_loc)
1339 vac%res = vac%res + iu*dum_2d
1358 &lim_sec_sol,lim_pos)
result(ierr)
1364 character(*),
parameter :: rout_name =
'reconstruct_PB3D_sol'
1369 type(
sol_type),
intent(inout) :: sol
1370 character(len=*),
intent(in) :: data_name
1371 integer,
intent(in),
optional :: rich_lvl
1372 integer,
intent(in),
optional :: lim_sec_sol(2)
1373 integer,
intent(in),
optional :: lim_pos(1,2)
1377 integer :: lim_sec_sol_loc(2)
1378 integer :: lim_mem(3,2)
1390 n_ev = var_1d%tot_i_max(3)-var_1d%tot_i_min(3)+1
1395 if (
present(lim_sec_sol)) lim_sec_sol_loc = lim_sec_sol
1398 call sol%init(mds,grid_sol,n_ev,lim_sec_sol)
1401 lim_mem(1,:) = lim_sec_sol_loc
1402 lim_mem(2,:) = [grid_sol%i_min,grid_sol%i_max]
1403 lim_mem(3,:) = [-1,-1]
1404 if (
present(lim_pos))
then
1405 lim_mem(2,:) = lim_mem(2,:) + lim_pos(1,1) - 1
1424 sol%val = sol%val + iu*dum_1d
1430 &rich_lvl=rich_lvl,lim_loc=lim_mem)
1439 &rich_lvl=rich_lvl,lim_loc=lim_mem)
1442 sol%vec = sol%vec + iu*dum_3d
1458 character(*),
parameter :: rout_name =
'get_PB3D_grid_size'
1461 integer,
intent(inout) :: n(3)
1462 character(len=*),
intent(in) :: grid_name
1463 integer,
intent(in),
optional :: rich_lvl
1464 logical,
intent(in),
optional :: tot_rich
1468 real(dp),
allocatable :: dum_1d(:)
1476 &
'n',rich_lvl=rich_lvl)
1484 if (
present(tot_rich) .and.
present(rich_lvl))
then
1485 if (tot_rich .and. rich_lvl.gt.1) n(1) = n(1)*2+1