IGMBaseLib 1.0
|
00001 00012 module Physical_Field_Manager 00013 00014 ! モジュール引用; Use statement 00015 ! 00016 00017 ! 種類型パラメータ 00018 ! Kind type parameter 00019 ! 00020 use dc_types, only: DP, & ! 倍精度実数型. Double precision. 00021 & TOKEN, & 00022 & STRING 00023 00024 ! 宣言文 ; Declaration statement 00025 ! 00026 implicit none 00027 private 00028 00036 type, public :: Physical_Field 00037 00040 character(TOKEN) :: field_name 00041 ! f2003: character(TOKEN), private :: field_name 00042 00045 character(STRING) :: long_name 00046 ! f2003: character(STRING), private :: long_name 00047 00050 character(TOKEN) :: units 00051 ! f2003: character(TOKEN), private :: units 00052 00055 integer :: field_rank 00056 ! f2003: integer, private :: field_rank 00057 00058 end type Physical_Field 00059 00060 ! 公開手続き 00061 ! Public procedures 00062 ! 00063 public :: Physical_Field_Init 00064 public :: get_field_name, get_long_field_name, get_field_rank, get_field_units 00065 public :: set_field_name, set_long_field_name, set_field_units 00066 00067 contains 00068 00069 00070 ! 00089 subroutine Physical_Field_Init(self, name, field_rank, long_name, units) 00090 00091 ! 宣言文 ; Declaration statement 00092 ! 00093 type(Physical_Field), intent(inout) :: self 00094 character(*), intent(in) :: name 00095 integer, intent(in) :: field_rank 00096 character(*), intent(in), optional :: long_name 00097 character(*), intent(in), optional :: units 00098 00099 ! 実行文 ; Executable statement 00100 ! 00101 self%field_name = name 00102 self%field_rank = field_rank 00103 00104 00105 if ( present(long_name) ) self%long_name = long_name 00106 if ( present(units) ) self%units = units 00107 00108 end subroutine Physical_Field_Init 00109 00110 ! 00123 function get_long_field_name(self) result(val) 00124 00125 ! 宣言文 ; Declaration statement 00126 ! 00127 type(Physical_Field), intent(in) :: self 00128 character(STRING) val 00129 00130 ! 実行文 ; Executable statement 00131 ! 00132 00133 val = self%long_name 00134 00135 end function get_long_field_name 00136 00137 ! 00150 subroutine set_long_field_name(self, long_name) 00151 ! 宣言文 ; Declaration statement 00152 ! 00153 type(Physical_Field), intent(inout) :: self 00154 character(*), intent(in) :: long_name 00155 00156 ! 実行文 ; Executable statement 00157 ! 00158 00159 self%long_name = long_name 00160 00161 end subroutine set_long_field_name 00162 00163 ! 00176 function get_field_units(self) result(val) 00177 ! 宣言文 ; Declaration statement 00178 ! 00179 type(Physical_Field), intent(in) :: self 00180 character(TOKEN) val 00181 00182 ! 実行文 ; Executable statement 00183 ! 00184 00185 val = self%units 00186 00187 end function get_field_units 00188 00189 ! 00202 subroutine set_field_units(self, units) 00203 ! 宣言文 ; Declaration statement 00204 ! 00205 type(Physical_Field), intent(inout) :: self 00206 character(*), intent(in) :: units 00207 00208 ! 実行文 ; Executable statement 00209 ! 00210 00211 self%units = units 00212 00213 end subroutine set_field_units 00214 00215 ! 00228 function get_field_rank(self) result(val) 00229 ! 宣言文 ; Declaration statement 00230 ! 00231 type(Physical_Field), intent(in) :: self 00232 integer val 00233 00234 ! 実行文 ; Executable statement 00235 ! 00236 00237 val = self%field_rank 00238 00239 end function get_field_rank 00240 00241 00242 ! 00255 function get_field_name( & 00256 & self & 00257 & ) result(name) 00258 00259 ! 宣言文 ; Declaration statement 00260 ! 00261 type(Physical_Field), intent(in) :: self ! 00262 character(TOKEN) name 00263 00264 ! 実行文 ; Executable statement 00265 ! 00266 00267 name = self%field_name 00268 00269 end function get_field_name 00270 00271 ! 00284 subroutine set_field_name(self, name) 00285 ! 宣言文 ; Declaration statement 00286 ! 00287 type(Physical_Field), intent(inout) :: self 00288 character(*), intent(in) :: name 00289 00290 ! 実行文 ; Executable statement 00291 ! 00292 00293 self%field_name = name 00294 00295 00296 end subroutine set_field_name 00297 00298 end module Physical_Field_Manager 00299