wrf 嵌套网格作用_在网格系统中使用响应列,嵌套列和偏移列 引导程序

本文介绍了Bootstrap网格系统中响应式列、嵌套列和偏移列的概念及使用方法。响应列根据设备视口大小使用不同网格布局,嵌套列通过在现有列内添加ROW和col-*-*实现内容测试,偏移列提供特殊布局,通过offset-*-*增加列的左边距。文中给出了实例说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

wrf 嵌套网格作用

介绍 (Introduction)

In the previous article, we have learnt what is grid and grid system and how it works? Now, we will learn about how Responsive column, Nesting Columns and Offset Columns works and how to use them? If you have any doubt, feel free to ask in the comment section.

在上一篇文章中,我们了解了什么是网格和网格系统以及它如何工作 ? 现在,我们将了解响应列,嵌套列和偏移列的工作方式以及如何使用它们 ? 如有任何疑问,请随时在评论部分提问。

响应列 (Responsive Columns)

We know that we have four grid classes (xs, sm, md, lg). So, in these Responsive columns, we use one or all four grid for layout, according to the device or viewport size. It’s up to you in how many columns you want to divide Grid individually in your page; on different devices and how many columns group you want on different devices.

我们知道我们有四个网格类( xs , sm , md , lg )。 因此,在这些“响应式”列中,根据设备或视口的大小,我们使用一个或所有四个网格进行布局。 由您决定要在页面中分别划分Grid的几列; 在不同的设备上,以及您希望在不同的设备上有多少列组。

Example:

例:

In the following example, the layout has been divided into two grid class (sm & md) for different device viewport. We are dividing here columns for small devices as .col-sm-4, .col-sm-4, .col-sm-4 and for large device.col-md-4 .col-md-3, .col-md-5.

在以下示例中,针对不同的设备视口,布局已分为两个网格类( sm & md )。 对于小型设备,我们在这里划分列为.col-sm-4 , .col-sm-4 , .col-sm-4和大型设备 .col-md- 4.col -md-3 , .col-md -5 。

<! ---------- Responsive columns ---------->
<h2 style="color:blue;">Responsive Columns</h2><br />

<div class="container-fluid">
	<div class="row">
		<div class="col-sm-4 col-md-3">
			<h3 style="background-color:skyblue;text-align:center;">
				we use 4 col in small and 3 col in large device in 12 columns.
			</h3>
		</div>

		<div class="col-sm-4 col-md-5">
		<h3 style="background-color:yellow;text-align:center;">
			we use 4 col in small and 5 col in large device in 12 columns.
		</h3>
		</div>
		<div class="col-sm-4 col-md-4">
		<h3 style="background-color:pink;text-align:center;">
			we use 4 col in small and 4 col in large device in 12 columns.
		</h3>
		</div>
	</div>
</div>

嵌套列 (Nesting Columns)

It is similar to something we have already used, that is; the nested loop and conditional statement in programming languages (In C, C++ & other). To test your content, you have to add a row and col-*-* class within an existing col-*-* class.

它类似于我们已经使用过的东西,即; 编程语言(在C,C ++和其他语言中)的嵌套循环和条件语句。 要测试你的内容,你必须添加一个ROW和COL - * - - *类现有的山坳内*类- *。

Note: The nested row should include scales up to 12 columns as the device or viewport.

注意:嵌套的行最多应包含12列作为设备或视口的比例。

Example:

例:

In the following example, layout has been divided into two columns .col-sm-8 and .col-sm-4 both are split into two parts, In which first one is split into .col-sm-4 and .col-sm-8 & second is split into .col-sm-6 and .col-sm-6.

在下面的示例中,布局已分为两列。.col-sm-8和.col-sm-4都分为两部分,其中第一个部分分为.col-sm-4和.col-sm -8 &秒分为.col-sm-6和.col-sm-6 。

<!----------- Nesting Columns --------------->
<h2 style="color:blue;">Nesting Columns</h2><br />

<div class="container-fluid">
	<div class="row">
		<div class="col-sm-8">
			<h3 style="background-color:lightgreen;text-align:center;"> 
				we use 8 columns in 12 columns.
			</h3>
			<div class="row">
				<div class="col-sm-4">
					<h5 style="background-color:Aqua;text-align:center;">4 col</h5>
				</div>
				<div class="col-sm-8">
					<h5 style="background-color:Aqua;text-align:center;">8 col</h5> </div>
				</div>
		</div>
		
		<div class="col-sm-4">
			<h3 style="background-color:lightgrey;text-align:center;">
				we use 4 columns in 12 columns.
			</h3>
			<div class="row">
				<div class="col-sm-6">
					<h5 style="background-color:Aqua;text-align:center;">6 col</h5>
				</div>
				<div class="col-sm-6">
					<h5 style="background-color:Aqua;text-align:center;">6 col</h5> 
				</div>
			</div>
		</div>
	</div>
</div>


Mobile and tablet view for Both Responsive and Nesting columns:

响应式和嵌套式列的移动设备和平板电脑视图:

Mobile tablet layout

Desktop view for Both Responsive and Nesting columns:

响应列和嵌套列的桌面视图:

desktop layout

偏移列 (Offset Columns)

You can also use offset grid columns. It provides a specialized layout. It also has four grid classes. For this, we have to use offset -*-*. These classes are used to increase the left margin of columns where columns can move an only right side and we increase left margin to the columns by using offset -*-* and it ranges from 1-11. Margins are more useful for quick layouts where the variable is the width of the offsets.

您也可以使用偏移网格列。 它提供了专门的布局。 它还具有四个网格类别。 为此,我们必须使用offset -*-* 。 这些类用于增加列的左边距,其中列只能向右移动,我们通过使用偏移量-*-*来增加列的左边距,范围为1-11。 边距对于变量为偏移宽度的快速布局更有用。

Offset columns in Bootstrap

Example:

例:

In the following example, specialized layout is used and divided into two columns (col-md-4 col-sm-4 col-lg-4) and (col-md-4 col-sm-4 col-lg-4). Here, we use offset in both the splitted columns offset-md-2 & offset-md-1 as you can see in the example. Under this spitted two columns we again use offset in contact; we use offset for margin where offset-md-2 & offset-md-0 moves over columns col-md-4 col-sm-4 col-lg-4 offset-md-2 & col-md-4 col-sm-4 col-lg-4 offset-md-1.

在以下示例中,使用专用布局并将其分为两列( col-md-4 col-sm-4 col-lg-4 )和( col-md-4 col-sm-4 col-lg-4 )。 在此示例中,我们在两个拆分列中使用了offset偏移量offset-md-2和offset-md-1 。 在这个分散的两列下,我们再次使用偏移量接触; 我们使用offset作为余量,其中offset-md-2和offset-md-0在列col-md-4 col-sm-4 col-lg-4 offset-md-2和col-md-4 col-sm-上移动4 col-lg-4 offset-md-1 。

<!----------- Offset Columns --------------->
<h2 style="color:blue;">Offset Columns</h2>
<br />
<div class="container-fluid">
<div class="row">
<div class= "col-md-4 col-sm-4 col-lg-4 offset-md-2">
<h1>Contact</h1>
<br>
<div class="row">
   <div class="col-sm-8 col-lg-5 offset-md-2">
      <form action="" target="_blank">
         <p><input type="text" placeholder="Name" class="box" required name="Name"></p>
         <p><input	type="text"
            placeholder="Comments"	required	name="Comment"	class="box"
            style=" height:150px;"></p>
         <p><button style="color:black; margin-left:35%" class="btn btn-info" type="submit"><b>SUBMIT</b></button></p>
      </form>
   </div>
</div>
<div class= "col-md-4 col-sm-4 col-lg-4 offset-md-1">
   <h1>Contact</h1>
   <br>
   <div class="col-md-5 col-lg-5 offset-md-0">
      <form action="" target="_blank">
         <p><input type="text" placeholder="Name" class="box" required name="Name"></p>
         <p><input	type="text"
            placeholder="Comments"	required	name="Comment"	class="box"
            style=" height:150px;"></p>
         <p><button style="color:black; margin-left:35%" class="btn btn-info" type="submit"><b>SUBMIT</b></button></p>
      </form>
   </div>
</div>

Mobile and tablet view for Offset columns:

偏移列的移动设备和平板电脑视图:

Mobile tablet layout

Desktop view for Offset columns:

偏移列的桌面视图:

desktop layout

Conclusion:

结论:

So, Let’s conclude with what we have learnt here.like-what is Responsive columns, Nesting columns, Offset Columns and how to use them, with examples. I hope now, you gained an insight into how can we use these different amazing classes for creating a responsive page. Stay tuned for the next article. We will dig deeper and discover more about Bootstrap. See you in the next Article! Happy Learning!

因此,让我们以在这里学到的内容作为结束。例如-什么是响应列,嵌套列,偏移列以及如何使用它们,并带有示例。 我希望现在,您了解了我们如何使用这些不同的惊人类来创建响应式页面。 请继续关注下一篇文章。 我们将更深入地探索并发现更多有关Bootstrap的信息。 下篇再见! 学习愉快!

翻译自: https://www.includehelp.com/html/use-of-responsive-nesting-columns-and-offset-columns-in-grid-system-bootstrap.aspx

wrf 嵌套网格作用

<think>我们正在处理用户的问题:“我想查看WRF模型中嵌套域的位置配置 请问WRF模型如何查看嵌套域的设置” 根据引用内容,我们可以总结出以下方法: 1. 使用QGIS设计嵌套网格(引用[1]) 2. 使用wrf domain wizard(引用[2]) 3. 使用NCL脚本wrf_wps_show_domain_namelist.ncl(引用[3]) 4. 查看namelist.input文件(引用[4]) 用户的问题是如何查看嵌套域的设置,因此重点在于如何可视化或查看已经配置好的嵌套域。 根据引用[3],我们可以使用NCL脚本`wrf_wps_show_domain_namelist.ncl`来可视化嵌套域。这个脚本可以从网上下载,然后修改脚本中的路径文件名,运行即可生成图形。 另外,引用[4]提到,在namelist.input文件中可以查看嵌套域的配置参数,包括每个域的大小、位置、父域、网格比例等。 因此,回答将分为两部分: 1. 通过查看namelist.input文件来了解嵌套域的参数设置。 2. 使用NCL脚本可视化嵌套域。 注意:用户可能没有安装NCL,因此需要说明安装NCL或者使用其他替代方法(如Python)。 另外,引用[2]提到了wrf domain wizard,这是一个图形化工具,适合初学者设计嵌套域,但用户的问题是如何查看已经配置好的嵌套域,所以这个工具可能不是直接用来查看的,但我们可以提及。 由于引用[1]是关于使用QGIS设计网格,这属于设计阶段,而用户的问题是如何查看,因此可能不是直接相关。 因此,我们重点放在: 1. 查看namelist.input文件 2. 使用NCL脚本可视化 3. 替代方法(如Pythonwrf-python包) 步骤: ### 1. 查看namelist.input文件 在WRF运行的目录中,有一个namelist.input文件,其中包含了嵌套域的配置。关键参数在`domains`部分: - `max_dom`:嵌套域的总数(包括父域) - 每个域的参数:`e_we`(东西向网格数),`e_sn`(南北向网格数),`i_parent_start`(子域在父域中的起始i坐标),`j_parent_start`(子域在父域中的起始j坐标),`parent_grid_ratio`(相对于父域的网格比例),`dx``dy`(父域的网格间距)等。 例如: ``` &domains max_dom = 2 start_date = '2020-01-01_00:00:00','2020-01-01_00:00:00' end_date = '2020-01-02_00:00:00','2020-01-02_00:00:00' e_we = 100, 121 e_sn = 100, 121 e_vert = 30, 30 dx = 30000, dy = 30000, grid_id = 1,2 parent_id = 1,1 i_parent_start = 1, 40 j_parent_start = 1, 40 parent_grid_ratio = 1,3 parent_time_step_ratio = 1,3 feedback = 1, / ``` ### 2. 使用NCL脚本可视化 步骤: 1. 下载NCL脚本:从引用[3]提供的链接下载`wrf_wps_show_domain_namelist.ncl`。 2. 修改脚本:设置`wks_type`(输出格式,如png)`wks_name`(输出文件名),并修改`dir``fname`指向你的namelist.wps或namelist.input文件(注意:该脚本通常用于namelist.wps,但也可以用于namelist.input,可能需要小修改)。 3. 运行脚本:`ncl wrf_wps_show_domain_namelist.ncl` ### 3. 使用Pythonwrf-python包 如果用户没有NCL,可以使用wrf-python包中的`getvar``to_np`函数结合cartopy等库绘制域。但注意,这通常用于输出结果,而域设计在WPS阶段。因此,更直接的方法是使用NCL脚本或查看namelist。 另外,WRF官方提供了一些工具,如`geogrid.exe`会生成`geo_em.d0*.nc`文件,这些文件包含了每个域的边界信息。我们可以使用NCO工具(如ncdump)查看,或者用Panoply等工具可视化。 ### 总结步骤: 1. **直接查看namelist.input**:了解域的具体参数。 2. **使用NCL脚本可视化**:直观显示域的位置嵌套关系。 3. **使用geo_em.d0*.nc文件**:通过NetCDF文件查看域的范围。 最后,生成相关问题。</think>### 如何查看WRF模型中嵌套域的位置配置 在WRF模型中查看嵌套域设置主要通过以下方法实现,分为参数查看可视化两种方式: #### 一、直接查看参数配置(核心方法) 在WRF的`namelist.input`文件中,`&domains`部分包含所有嵌套域的位置参数: ```bash &domains max_dom = 3 # 总嵌套层数(含父域) parent_id = 1, 1, 2 # 各域的父域ID parent_grid_ratio = 1,3,3 # 网格细化比例 i_parent_start = 1, 30, 45 # 子域在父域的起始X格点 j_parent_start = 1, 25, 40 # 子域在父域的起始Y格点 e_we = 100, 121, 151 # 东西向网格数 e_sn = 100, 121, 151 # 南北向网格数 dx = 9000, 3000, 1000 # 网格分辨率(米) / ``` **关键参数说明**: - `i_parent_start`/`j_parent_start`:子域左下角在父域网格中的坐标位置 - `parent_grid_ratio`:子域相对于父域的分辨率比例(如3表示分辨率提高3倍) - `e_we`/`e_sn`:定义每个域的东西/南北方向网格数量 - `dx`/`dy`:父域网格分辨率(子域分辨率自动按比例计算) > 注:参数设置规则详见WRF用户手册第3章第5章[^4] #### 二、可视化嵌套域位置 1. **NCL脚本可视化**(推荐) 使用官方脚本`wrf_wps_show_domain_namelist.ncl`: ```bash # 下载脚本 wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/wrf_wps_show_domain.ncl # 修改脚本指向你的namelist.input sed -i "s/namelist.wps/namelist.input/g" wrf_wps_show_domain.ncl # 运行生成可视化图 ncl wrf_wps_show_domain.ncl ``` ![输出示例](https://www2.mmm.ucar.edu/wrf/OnLineTutorial/graphics/ncl_wsd.png) *脚本会自动生成嵌套域位置叠加地图的PNG文件[^3]* 2. **QGIS辅助设计**(设计阶段) 通过QGIS的网格工具绘制嵌套域,结合中国底图校准位置(需手动计算格点): ```python # 伪代码示例:计算子域实际经纬度 父域左下角经纬度 = (lon0, lat0) 子域X偏移 = i_parent_start * 父域分辨率 子域Y偏移 = j_parent_start * 父域分辨率 子域左下角实际位置 = (lon0 + 偏移经度, lat0 + 偏移纬度) ``` 此方法适用于设计阶段验证网格位置[^1] 3. **WRF Domain Wizard**(初学者工具) 图形化界面实时显示域配置,支持动态调整参数: ```bash # 启动工具 ./domain_wizard.py ``` ![Domain Wizard界面](https://www2.mmm.ucar.edu/wrf/users/docs/domain_wizard_screenshot.png) *自动计算域间位置关系并显示地图叠加效果[^2]* #### 三、输出文件验证 运行`geogrid.exe`后生成的`geo_em.d0*.nc`文件包含域边界信息: ```bash ncdump -h geo_em.d01.nc | grep -E "WEST|SOUTH" # 输出示例: WEST-EAST_GRID_DIMENSION = 100 ; SOUTH-NORTH_GRID_DIMENSION = 100 ; WEST_EDGE = 116.0f ; // 西边界经度 SOUTH_EDGE = 39.5f ; // 南边界纬度 ``` > **注意事项**: > 1. 父域(d01)的`i_parent_start``j_parent_start`固定为1 > 2. 网格数`e_we`/`e_sn`需比实际多1(因包含边界点) > 3. 嵌套比例必须是奇数(3/5/7)以保证网格对齐
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值